I have the following data frame, df in R:
ID Name Class
3 John 3A
32 Fanny 7B
12 Greg 3A
and I want to segregate the data, by creating a new dataframe for all rows with Class value 3A which means the new dataframe would be:
ID Name Class
3 John 3A
12 Greg 3A
Since rows above have value 3A in the Class column.
I tried the following:
df_2 <- df[df["Class"]=="3A"]
But the df_2 dataframe does not seem to appear.