I have a SpatialPointsDataFrame read via rgdal::readOGR
require(rgdal)
my_sp_layer <- readOGR(dsn="my_dsn", layer="my_layer_file")
# select rows using col_attrib column
my_sp_layer@data[my_sp_layer@data$col_attrib == 'some value',]
How can I update the values of the selected rows?
If it is a data.table, I would just use
my_data_table[col_attrib == 'some value', col_to_update := 'new value']