I'm new to R and want to calculate the RMSE of two groups of data held within the same .csv file.
.csv contains something like this:
Group X Y
A 2 2
A 3 2
B 2 7
B 6 5
My poor attempt at retrieving the RMSE for just those in Group A:
myData=read.csv("foo.csv")
attach(myData)
library(Metrics)
if (row.names(A)) {
rmse(x,y)
}
Do I need to append A and B to seperate dataframes before I can calculate RMSE, or is there a better way to achieve this?
Thanks in advance!