Share

10.6 Jitter UTM coordinates before making SpatialPointsDataFrame

#Jitter x coordinate before making dataframe
muleys$Xj <- jitter(muleys$X, factor=50, amount=NULL)
muleys$Yj <- jitter(muleys$Y, factor=50, amount=NULL)
coords2<-data.frame(x = muleys$Xj, y = muleys$Yj)
crs<-"+proj=utm +zone=12 +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0"
jitter.spdf <- SpatialPointsDataFrame(coords= coords2, data = muleys, proj4string = CRS(crs))
proj4string(jitter.spdf)
points(jitter.spdf, col="red")