I am using sp::merge
to merge SpatialPologynDataFrame
with data.frame:
z <- merge(x, y, by.x = "field1", by.y = "field2")
merge() annoys me with Warning message: In .local(x, y, ...) : 12 records in y cannot be matched to x
, which I am very well aware of. How to make him quiet? I did try to put all.y = FALSE
. It would feel kinda stupid to have to pre-filter y to only those who match to x. This is what merge is supposed to do, just without kidding :-)
PS: I didn't ask for global warning suppression, just how to disable in this function.
PS 2: I still don't understand why sp::merge() warns about this, when base::merge() doesn't!:
z <- merge(x@data, y, by.x = "field1", by.y = "field2")
# spatial info dropped, base::merge() called, no warning now