I am trying to save the results of all interactions, but for loop only gives me the result of last interaction. Just like this:
l <- list(a = c(1, 3, 5), b = c(4, 8), c = 2)
df <- data.frame()
for (i in 1:length(l)) {
s <- data.frame(name = names(l[i]),
value = mean(l[[i]]))
out <- rbind(df, s)
}
This code returns this:
I need to something like this:
How can I solve this?
Thanks in advance!

