Beginner problem in R. I have a data frame in R that has 1 column ranking the data into specific subgroups, named "Group" (Groups: Heavy, Medium, Light), then another column with values (named "Value") of those groups. How do I check, for example the mean, within the "value" column for a specific subset based on the "Group" column, lets say for "Heavy"?
Asked
Active
Viewed 18 times
1
-
Just do `aggregate(Value ~ Group, df1, mean)` If it is for specific subset, `mean(df1$Value[df1$Group == "Heavy"])` – akrun May 29 '19 at 05:39