Jump to content

R charts in spotfire from list of charts


John martin 4

Recommended Posts

Hi All,

I am trying to creat a single chart from multiple charts created in a loop. I cannot seem to get these charts called from the list of charts. ( i can get this working prefectly in Rstudio)

In the code below i create a test dataframe with two groups (wells) and run these in the loop to creat a list of charts (well_list). I can call the data from well_list(usingwellA = well_list[['A']][['data']]) and use this data to create charts andplot so the list is being created ok (outplot)

However what i want to do is call chart directly from the list ( in my real application the chart is quite complex and the y ranges etc are set within the loop), when i call sometihng likea = well_list[['A']] in the Rgraph part of the code i keep getting an error message "could not find function "check_nondata_cols" which i dont seem to be able to get around.

Any suggestions most welcome! many thanks.

 

library(ggplot2)

library(gridExtra)

library (RinR)

df1 = data.frame(replicate(2,sample(0:200,100,rep=TRUE)))

df1$depth = seq.int(nrow(df1))

df1$well = ("A")

df2 = data.frame(replicate(2,sample(0:200,100,rep=TRUE)))

df2$depth = seq.int(nrow(df1))

df2$well = ("B")

df3 = rbind (df1,df2)

well_list = list()

for(i in unique(df3$well)) {

 

well

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...