For this dataframe:
df = data.frame(
col = c("a","f","g","a")
)
How do I subset it for each unique letter and input it into a new dataframe like so?:
sheet_a <- subset(df, col == "a")
sheet_f <- subset(df, col == "f")
sheet_g <- subset(df, col == "g")
I think I need to use a column of unique characters using the below code in a for loop but I'm not sure how
uniq.name_col <- unique(as.vector(df$col))
Thank you for any help!