I am trying to subset a dataframe with the following function.
SubsetDF <- function(DF, VAR, YEAR){
DF2 <- DF[DF$VAR <= YEAR, ]
return(DF2)
}
test <- SubsetDF(myData, "YEAR", 2000)
The resulting "test" is empty. What am I missing here? By the way, if I just do below, then the resulting dataframe is fine.
myData[myData$YEAR <= 2010,]