I am wanting to create a individualized data sets partitioned by a categorical variable within a data frame.
I am wanting to take something like this and apply a function that will give me three different data sets
head(df,10)
> color value
> red 1
> red 2
> red 3
> blue 1
> blue 2
> blue 3
> green 1
> green 2
> green 3
> green 4
I imagine I would be using the assign() function to some kind of use like:
assign(paste0("color-",df$color), df$value
Ideally I would like to have
color-red
> value
> 1
> 2
> 3
color-blue
> value
> 1
> 2
> 3
etc...