0

I would like to create 113 dataframes extracted from the megalist players11 using a LOOP or function

I tried this following but it only create one dataframe for the player 113

for (i in 1:113) {
  data_i = as.data.frame (do.call(rbind,as.data.frame (do.call(rbind, players11))[[1]][[i]]))
}

Thank you!

Rui Barradas
  • 70,273
  • 8
  • 34
  • 66
eli v
  • 1
  • 1
  • 7
    `data <- list(); for (i in 1:113) data[[i]] <- data.frame(...)` – r2evans Oct 03 '22 at 19:01
  • 1
    Can you post sample data? Please edit the question with the output of `dput(players11)`. Or, if it is too big with the output of `dput(head(players11, 20))`. – Rui Barradas Oct 03 '22 at 19:13
  • FYI, it is generally recommended to work with a [list of frames](https://stackoverflow.com/a/24376207/3358227) instead of 113 independent frames in the environment. This is for a number of reasons, most notably that in cases like this, it seems very likely that something you do to one frame you'll also do to another frame in the list. So if you're going to do `myfun(data[[1]])`, you can do that for all frames with `lapply(data, myfun)`. – r2evans Oct 03 '22 at 20:28

0 Answers0