0

I exported many lists using

> capture.output(list, file="list.txt")

but now i want to import them back. The format of each list goes something like this

>$`Chapter 1`
>$`Chapter 1`$`Section 1` 
>[1] value1 value2 value3 ... value32
>[33] value33 value34 value35 ...
>...
>[200] value200 value201 ... valuen
>
>$`Chapter 1`$`Section 2`
>...
>$`Chapter 2`
>$`Chapter 2`$`Section 1`

you get the idea of the format of the list. The lists are quite long and there are many of them. I thought it would be easy to import them but it doesn't seem like it. I tried with read.table and read.delim but it doesn't do what i want and it imports it as a data frame with the wrong structure.

I consulted the answers here and here but with not much success.

Should i use some regex on the file? or import it line by line, what's the easiest, R-way of doing this?

asd11
  • 101
  • 2

0 Answers0