[R-sig-Geo] add random fluctuation x and y coordinates

ONKELINX, Thierry Thierry.ONKELINX at inbo.be
Wed Oct 17 09:49:17 CEST 2007


You need to do 

jitter(test$x, amount = 0.01)

instead of

jitter(test$x, amount = test$x + 0.01)

HTH,

Thierry

------------------------------------------------------------------------
----
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature
and Forest
Cel biometrie, methodologie en kwaliteitszorg / Section biometrics,
methodology and quality assurance
Gaverstraat 4
9500 Geraardsbergen
Belgium
tel. + 32 54/436 185
Thierry.Onkelinx at inbo.be
www.inbo.be 

Do not put your faith in what statistics say until you have carefully
considered what they do not say.  ~William W. Watt
A statistical analysis, properly conducted, is a delicate dissection of
uncertainties, a surgery of suppositions. ~M.J.Moroney



> -----Oorspronkelijk bericht-----
> Van: r-sig-geo-bounces at stat.math.ethz.ch 
> [mailto:r-sig-geo-bounces at stat.math.ethz.ch] Namens Eva Kaiserseder
> Verzonden: woensdag 17 oktober 2007 8:32
> Aan: r-sig-geo at stat.math.ethz.ch
> Onderwerp: [R-sig-Geo] add random fluctuation x and y coordinates
> 
> 
> 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 at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> 




More information about the R-sig-Geo mailing list