0

I have several text files that stores list data (from a output of a model) like this.

[[1]]
[[1]][[1]]
[1] "gender"           "n_sum"           "delq"        "i_sum"          
[5] "bf_mj"

[[1]][[2]]
[1] "gender"    "n_sum"    "delq" "c_sum"    "e_sum"    "race_bin" 

[[1]][[3]]
[1] "gende"            "delq"         "e_sum"           
[4] "race"          "parnt_edu"  "bf_alc"

[[1]][[4]]
character(0)

Is there a way to import these kind of text files into R?. I tried read.csv and read.table. But it didn't work.

Any kind of help is highly appreciated. Thank you

student_R123
  • 962
  • 11
  • 30
  • How did you get the data above? Perhaps [text file to list](https://stackoverflow.com/questions/6602881/text-file-to-list-in-r). – Chris Oct 30 '22 at 00:47
  • 1
    In the future, do not save lists as text files, use `saveRDS()` or `save()`. This is especially true if any of the values are numeric since printing a list generally loses numeric precision. – dcarlson Oct 30 '22 at 02:54

0 Answers0