I have a very big data frame with more than 400.000 rows and I want to split them into smaller data frames based on their Customer ID. I know there are some questions about splitting data and I did try, it worked though it just 1 by 1 split the data frame. I want to make it automatically splitting all since there are more than 100.000 subsets. So can anyone help me with this? Thank you so much
Here is my code
List <-lapply(unique(CheckinHistory$CustomerID), function(x) CheckinHistory[CheckinHistory$CustomerID == x,])
purrr:::reduce(a[1], rbind.data.frame)
for(i in 1:114420)
a[i] <- purrr:::reduce(List[i], rbind.data.frame)
R doesn't understand and claims a[i] doesn't exist. But if I code
List <-lapply(unique(CheckinHistory$CustomerID), function(x) CheckinHistory[CheckinHistory$CustomerID == x,])
purrr:::reduce(a[1], rbind.data.frame)
a[1] <- purrr:::reduce(List[1], rbind.data.frame)
Then it works but there are more than 100.000 subsets of this data frame so I cant code them 1 by 1 like that way. Once again, many thanks!