Displaying 2 results from an estimated 2 matches for "results5".
Did you mean:
results
2012 Jan 17
2
result numeric(0) when using variable1[which(variable2="max(variable2)"]
...start with
results4$depth_ following by the number. The numbers are constructed as:
seq(1,10,0.1). But if the R squared values are now in 1 column, I don?t know
for which column they are calculated. So I made a new data frame with both
columns:
R2 <- unlist(LIST)
Cvalue <- c(seq(1,10,0.1))
results5 <- data.frame(Cvalue,R2)
# I know I can calculate the max value of Rsquared by this way:
max(results5$R2)
# now I want to know to which Cvalue this belongs. I would write it like
this:
results5$Cvalue[which(results5$R2 == "max(results5$R2)")]
# But I always get the solution:
n...
2012 Jan 11
3
Accomplishing a loop on multiple columns
Hello,
I have a question concerning ?for loops? on multiple columns.
I made 91 columns with results (all made together with a for loop) and I
want to us lm to fit the model.
I want to compare the results of all these calculated columns (91) with one
column with observed values. I use the function lm to fit the model and
calculate r.squared. I manage to do this for each column separately:
For