r <- rast(ncols=36, nrows=18)
r[500] <- 1
b <- buffer(r, width=5000000)
plot(b)
v <- vect(rbind(c(10,10), c(0,60)), crs="+proj=merc")
b <- buffer(v, 20)
plot(b)
points(v)
crs(v) <- "+proj=longlat"
b <- buffer(v, 1500000)
plot(b)
points(v)
Run the code above in your browser using DataLab