Pretty silly but I can't figure out what I'm doing wrong here:
I have a data.frame with 2 columns:
df = data.frame(x = rep(1, 20), y = runif(20, 10,20))
I then want to set x and y as spatial coordinates so I can plot df in a bubble plot. So I try:
coordinates(df) = c("x","y")
But then:
bubble(df)
gives this error:
Error in data.frame(x@data, x@coords) :
arguments imply differing number of rows: 0, 20

