I have been working on a dataset of folders and subfolders (folder -> subfolder - > file)
I have trouble reading the first 10 folders of data. I have used the below code but it doesn't work. Please help

```
> for(i in seq_along(my_folders)){
+ my_data[[[i]]] = list.files(path = "~/dataset1", recursive = TRUE)

```

Below see problem with reading txt file in subfolder:

```
> for(i in 1:13){
+ current_dir = dirs[i]
+ lines = readLines(mydata[[i]])}

```

This gives error: Error in file(con, "r") : invalid 'description' argument

But outside of the loop this works:

```
> lines <- readLines(my_data[[1]])

```