Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Unlist a list of dataframes in R

I have a list of dataframes that I have created using

list_dataframes = list(dataframe_1, dataframe_2...)

And now I wonder how to unlist this list.

I have searched for it and found this solution:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

list2env(list_dataframes ,.GlobalEnv)

in this old question: Unlist a list of dataframes

However, when using that solution, the following error arises:

Error in list2env(list_dataframes, .GlobalEnv) : 
  names(x) must be a character vector of the same length as x

Any idea why it’s happening?

Thanks!

>Solution :

The error is a result of passing a list without names

list2env(list(1, 2, 3), .GlobalEnv)

Error in list2env(list(1, 2, 3), .GlobalEnv) : names(x) must be a
character vector of the same length as x

list2env(list(a= 1, b = 2, c = 3), .GlobalEnv)
<environment: R_GlobalEnv>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading