Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 206180

Remove rows contains certain value from spatial dataframe

$
0
0

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?


Viewing all articles
Browse latest Browse all 206180

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>