search for: runifpoint

Displaying 12 results from an estimated 12 matches for "runifpoint".

2005 Oct 10
3
Vectorizing loop
Hi I have the following loop and would like to vectorize it. Any ideas if it is possible? Thanks, Rainer Tha Loop: for (i in 2:Result$NoSims) { ppp <- runifpoint(Result$NoPlants) K <- Kest(ppp) Result$LSim[i,] <- sqrt(K$iso / pi) - K$r CM <- (Result$LSim[i,] * Result$LSim[i,]) / abs(K$r[2] - K$r[1]) Result$SigCM[i] <- sum(CM, na.rm=TRUE) print(i) flush.console() } -- NEW TELEPHONE NUMBER Tel: +27 - (0)72 808 2975 (w) Rainer M. K...
2007 Oct 03
2
Speeding up simulation of mean nearest neighbor distances
I've written the function below to simulate the mean 1st through nth nearest neighbor distances for a random spatial pattern using the functions nndist() and runifpoint() from spatsat. It works, but runs relatively slowly - would appreciate suggestions on how to speed up this function. Thanks. --Dale library(spatstat) sim.nth.mdist <- function(nth,nsim) { D <- matrix(ncol=nth, nrow=nsim) for (i in 1:nsim) { rpp <- runifpoint(22, win=owin(c(0,1),c(0,1...
2005 Oct 10
5
Show Progress in loop
...here it is in it's calculations. I tried to simply show the counter variable in the loop, but id doesn't work as all display seems to be delayed until the loop is completed. Is there any way of displaying the progress of a loop? Rainer The loop: for (i in 2:Result$NoSims) { ppp <- runifpoint(Result$NoPlants) K <- Kest(ppp) Result$LSim[i,] <- sqrt(K$iso / pi) - K$r CM <- (Result$LSim[i,] * Result$LSim[i,]) / abs(K$r[2] - K$r[1]) Result$SigCM[i] <- sum(CM, na.rm=TRUE) i #<========================Doesn't display in the loop } -- Rainer M. Krug, Dipl. Phys. (Germ...
2004 May 29
1
Rhelp: Need help interpreting plots in spatstat
...me. You can see a pdf of the resulting plot if you download it from my website : www.bol.ucla.edu/~lschwei/sample.pdf WARNING: this is immediate download. THE CODE: ###### ghat.env <- function(n, s, r, win=owin(myOwin){ hold <- matrix(0, s, length(r)) for(i in 1:s){ hold[i,] <- Gest(runifpoint(n, win=myOwin), r=r)$raw } mn <- apply(hold, 2, mean) Up <- apply(hold, 2, max) Down <- apply(hold, 2, min) return(data.frame(mn, Up, Down)) } tsds.ghat <- Gest(tsdspoints) tsds.ghat.short <- tsds.ghat[tsds.ghat$r <= .15, ] tsds.cdf <- 1-exp(-40*pi*(tsds.ghat.short$r^2)) plot(t...
2007 Mar 26
2
sampling from the uniform distribution over a convex hull
...er still) code for sampling > from the uniform distribution over the convex hull of a set of > points? This is implemented in library 'spatstat'. If x and y are vectors of coordinates of your initial set of points, library(spatstat) W <- convexhull.xy(x, y) P <- runifpoint(42, W) will compute the convex hull and generate 42 independent uniformly-distributed points in the convex hull. The result can be plotted by plot(P) and the coordinates of the simulated points can be extracted as P$x and P$y. Adrian Baddeley
2008 May 09
1
save to file
Hi, I am new to R. I am using spatstat package to generate some sample points but don't know how to save the result to file. Could anyone please give me some instructions? Thanks I generate some random point data by using: pp<-runifpoint(100) I can plot it out with plot(pp) I suppose that pp contains x and y. How can I save these x, y pairs to file that has following format? x1,y1 x2,y2 ... ... ... Thanks again Steve _________________________________________________________________ Get Free (PRODUCT) REDâ„¢ Emoticons, Winks and Di...
2007 Dec 09
1
spatstat questions
Um texto embutido e sem conjunto de caracteres especificado associado... Nome: n?o dispon?vel Url: https://stat.ethz.ch/pipermail/r-help/attachments/20071209/130cf9d6/attachment.pl
2012 Jul 02
1
SPATSTAT: Minimum points for a Ripley K to be sensible?
Hello, What are the minimum number of points in a point pattern before a clustering analysis using a Ripley K function loses any meaning? I haven't been able to find much comment in the literature about this --- instead case examples typically use 100-200 points as a minimum. Regards, Sebastian Pucilowski
2017 Nov 28
0
Extract all point in a quadrats by spatstat package
Hi, With the following code i can divides window into quadrats and counts the numbers of points in each quadrat. library(spatstat) X <- runifpoint(50) quadratcount(X) quadratcount(X, 4, 5) quadratcount(X, xbreaks=c(0, 0.3, 1), ybreaks=c(0, 0.4, 0.8, 1)) qX <-? quadratcount(X, 4, 5) plot(X) plot(qX, add=TRUE) But I want to mark each? quadrats? and select/ extract only those points by selecting quadrats id .? Can anyone plese help me regard...
2013 Apr 15
2
nearest stations in distance matrix
Dear R-user, Is there a way in R to locate the nearest 5 indices to a station, based on distances in a distance matrix. In other words i want to have nearest stations based on the distances in the matrix. The distance matrix, i have, has dimension 44*44. Thankyou very much in advance Elisa [[alternative HTML version deleted]]
2005 Dec 29
3
importing shapefiles into spatstat
Dear R users, I am using spatstat to analyze point patterns (tree locations). I would like to import the shapefile with the study area polygons (six total) into R and use it to create the window for the spatstat analysis. I do not simply want to use a rectangle because the study areas spread out over 40000 ha. Any suggestions would be greatly appreciated. Thanks, Charlotte Reemts Charlotte
2007 Apr 04
6
transition matrices
I am working with transition matrices of sequences of animal behaviours. What I would like to do is parse the original matrices, adjusting row/column order so that the matrix has its main values in blocks surrounding the diagonal. This would cause behaviours involved in functional groupings (e.g. grooming, resting, foraging etc) to appear as blocks. This can be done manually by applying