5
Hello,
I am drawing a loop and at a certain precise moment select the dataframe with the highest number of lines within a list.
Example:
df1 <- data.frame(a = 1:15)
df2 <- data.frame(b = 1:35)
df3 <- data.frame(c = 1:105)
lista <- list(df1, df2, df3)
# resultado esperado lista[[3]]
Somehow, I wish I could say "return me the list element with higher nrow() .
Thanks for your help!
The other possibility is to calculate the number of lines inside the loop. Something like this: outside the loop: vec <- Numeric(). Inside the loop: vec[i] <- nrow(df1); list(df1, df2, df3)[[which.max(vec)]]
– Manoel Galdino