I have a list of data sets that I need to loop through and save the output. the names assigned belong to a character vector. For example:
list_data <- mtcars %>% group_split(cyl)
names_vector <- c("low", "medium", "high")
# this is what I am doing
low <- list_data[[1]]
medium <- list_data[[2]]
high <- list_data[[3]]
The names assigned belong to the character vector and it needs to be in order. the number of datasets in the list match the length of names_vector. but this needs to be iterated using a loop or some purr/dplyr functions.
Thanks