I have a list train_set
with 20 dataframes. I want to extract 10 dataframe in one list, and the remaining 10 in another list. I tried doing this train_df1 <- train_set[[c(1:10)]]
, but it's giving me error.
Asked
Active
Viewed 16 times
0

pkha
- 95
- 7
-
1`train_set[1:10]` - `[[` is for selecting *one* item only. – thelatemail Sep 01 '22 at 04:58
-
Probably a duplicate of [The difference between bracket \[ \] and double bracket \[\[ \]\] for accessing the elements of a list or dataframe](https://stackoverflow.com/questions/1169456/the-difference-between-bracket-and-double-bracket-for-accessing-the-el) – thelatemail Sep 01 '22 at 04:59
-
@thelatemail thank you!!! I see where i made the mistake. – pkha Sep 01 '22 at 05:01