Hi peers in below data i want to subset values with M in Sex Column, when i am using filter function i am getting following error


My Program:

Males <- Filter(Class_, Sex=="M")

Log: Error in get(as.character(FUN), mode = "function", envir = envir) :
object 'Class_' of mode 'function' was not found

R is case sensitive. There is no function “Filter” currently in namespace. (Update: I was wrong about Filter() not being in namespace, it is in {base}, so of course it is. However, it was misused.)
For a data frame named d

Males <- d[which(d$Sex == “M”),]

will return a data frame.