You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
make data a list and store each data frame loaded by the loop as one position in that list, so the first time through the loop the data frame gets stored in the first position in the list, the second time through the loop it gets stored in the second position, and so on. You can see some of the basic ideas in our Looping By Index video: https://www.youtube.com/watch?v=vWj5rypEZ4U&t=9s The modified version of the code would look like:
Load all of the data into a single data frame. Technically you can do this using a loop by each time through the loop loading the new data and then appending it (using rbind) to the bottom of the data frame, but it's now easier to do it with a single command from the purrr package:
data<- map_dfr(data_files, read.csv)
The text was updated successfully, but these errors were encountered:
From my comment on YouTube:
data
a list and store each data frame loaded by the loop as one position in that list, so the first time through the loop the data frame gets stored in the first position in the list, the second time through the loop it gets stored in the second position, and so on. You can see some of the basic ideas in our Looping By Index video: https://www.youtube.com/watch?v=vWj5rypEZ4U&t=9s The modified version of the code would look like:The text was updated successfully, but these errors were encountered: