In SAS there is the capability to remove an observation through a simple if statement. For instance if I wanted to delete the rows where Year = #. I could write:
If year == "#" then delete;
Is there an equivalent way in r? I tried this:
DF<- DF[!(DF$Year == "#"),]
Data set in R:
Year Month
# June
# July
# August
2015 August
But when I run DF$year, I still get # as a factor level when I thought it would be filtered out?