I am given two data sets.
Small Cars
3 | 3,3,3,3,4,4,4,4,4,4,4,5,6,7,7,7
4 | 5
5 | 0
Sporty Cars
2 | 9,9,9,9,9,9,9
3 | 0,0,0,0,0,0,0,1,1,1,1,1,2,2,2,2,3
I am then asked to find the mean but I am not sure how to do that in R. I get to the point where I get the values on a table where the columns are MPG, Small, Sporty. But not sure what to do afterwards. And I am new to R so it is a bit harder.



You can use the mean() function on a numeric vector to return the mean. If your data table is called "df", and the column you want to find the mean for is called "MPG", then you can use mean(df[["MPG"]]) to get the mean for the column MPG.