Dear List,Sorry for posting again the same question but up to now not all 
things are clear.
I've got a point pattern and a few events have duplicated coordinates. In this 
way I want to add a minimal random fluctuation in the x and y 
direction/coordinates. If I use the jitter-function my fluctuations are too 
large. So I tried to control it with the amount argument, but I can't find a 
solution. How can I restrict them to the decimal places?Thanks a lot for your 
help!Best regards, Eva
I tried something like this, to add fluctuation after the second decimal place:
v1 <- c(428381.6, 428871.6, 408027.2, 406870.4)
v2 <- c(293884.6, 292929.8, 292621.0, 292014.1)
test <- as.data.frame(cbind(v1, v2))
colnames(test) <- c("x", "y")
coordinates(test) <- c("x","y")
# ? ? ? ? ?
r <- runif(length(v1), -0.01, 0.01)
jitter(test$x, amount = test$x + r)
jcoord <- cbind(jitter(test[,1], amount = test[,1] + r), jitter(test[,2], 
amount = test[,2] + r))
 
_________________________________________________________________


        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@stat.math.ethz.ch
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Reply via email to