[ad_1]
maybe not the best way to do it, but will get the job done.
vars_df = unique(df$x)
for (i in 1:length(vars_df)) {
assign(paste0(vars_df[i]), df %>% filter(x == vars_df[i]), envir = .GlobalEnv)
}
[ad_2]
solved Automatically subset data frame by factor