I have downloaded some Rdata
files using getMasterIndex
function from edgar
package.
Now I am trying to load all of these files into RStudio using the following code -
paths <- list.files('Master Indexes', pattern = '[.]Rda$', full.names = TRUE)
files <- map (paths, load)
list_rbind(files)
The output of the files
dataset is, but there should be data in it.
[[1]]
[1] "year.master"
[[2]]
[1] "year.master"
[[3]]
[1] "year.master"
The output of the code list_rbind(files)
is -
Error in `list_rbind()`:
! Each element of `x` must be either a data frame or `NULL`.
ℹ Elements 1, 2, and 3 are not.
Run `rlang::last_trace()` to see where the error occurred.
However, the last Rda
file is loaded in RStudio
with the name being year.master
I have also used the for loop
function, but the results remain the same.
I tried to take help from this page, but it does not work - Using purrr to load multiple rda files
My goal is to put all of the Rda files into a list and then convert it into a dataframe.