Re: [R] assigning suitability index value

2021-08-10 Thread Marna Wagley
Thank you Jeff. I think the code you wrote works. The value I put in the output was just guessing by looking at the graph. Thank you once again Jeff. temp<-structure(list(X = c(1468285.96, 1468476.96, 1468479.96, 1468482.96, 1468485.96, 1468467.96, 1468470.96, 1468473.96, 1468476.96, 1468479.96, 1

Re: [R] assigning suitability index value

2021-08-10 Thread Jeff Newmiller
Piecewise linear interpolation is implemented in the ?approx function. It does not agree exactly with your Output, I don't know if there is something else you are accounting for it if your Output is in error. temp$index <- approx( table2$temp, table2$Index, temp$temp )$y BTW your code was usabl

[R] assigning suitability index value

2021-08-10 Thread Marna Wagley
Hi R Users, I have two tables, one is temperature data (temp) and another table is a suitability index. I wanted to assign the suitability index value in the temperature data (temp) based on Table 2 (or graph, which is a suitability curve), but I could not figure it out. Are there any suggestions f