I want to remove the rows have certain values from the spatial dataframe since the standard R grep() seems not propagate through all slots of an sp class object.
bd@data[- grep("xcluded", bd@data$Notes),]
It gives me an error: Error: trying to get slot "data" from an object (class "data.frame") that is not an S4 object
I read that sp.na.omit can remove NA but don't know how to remove the rows have a certain value(eg. remove rows that have "exclude" in bd@data$Notes). Any suggestions?