[R-sig-Geo] Question of ppm warnings of print.ppm

2010-09-27 Thread Adrian Baddeley
r this problem. Adrian Baddeley > I have been found guilty of having NA values in my > covariate-images (a categorical variable), > and have thus been receiving a lot of warnings. > Having fitted my model and in attempt to print a summary > (or the ppm model) my scr

[R-sig-Geo] qqplot.ppm

2010-09-23 Thread Adrian Baddeley
e argument 'control' described in help(qqplot.ppm) or help(rmhcontrol). Set control$expand = 1 so that no expansion of the simulation window occurs. For example: qqplot.ppm(Hard0, fast=TRUE, plot.it=FALSE, nsim=39, control=list(nrep=1e5, expand=1)) Use nsim=39 to get 5% significance ba

[R-sig-Geo] uniform weighted (non-Gaussian) kernel in density.ppp

2010-08-29 Thread Adrian Baddeley
requires a separate, slower algorithm (identical to the 'scan statistic' and implemented in non-R software like SatSCAN). This algorithm is already implemented in C inside spatstat, and requires only an R interface, which I will add in the next version of spatstat. Adria

Re: [R-sig-Geo] Function for subsampling spatial data

2010-08-25 Thread Adrian Baddeley
differently coloured points. In the split pattern Y, each component Y[[1]], Y[[2]] etc is a subset of the kind you were wanting. There are 7 components. I hope this is what you were seeking best wishes Adrian Baddeley On 24/08/10 20:52, Songhurst, Anna wrote: Dear Dr Baddeley and Dr T

[R-sig-Geo] test for CSR in three dimensions

2010-03-16 Thread Adrian Baddeley
e la Cruz as follows below (thanks, Marcelino!) Adrian Baddeley = n <- nrow(coords(X)) volume <- volume.box3(as.box3(X)) lambda <- n / volume # observed isotropic corrected K kobs <- K3est(X, rmax=1,nrval=101)$iso #99 simul

[R-sig-Geo] complement part of a polygon in another polygon

2010-01-28 Thread Adrian Baddeley
m <- complement.owin(B, frame=bounding.box(A)) AminB <- intersect.owin(A, Bcom) If you want the answer to be a polygon, you'll need to set spatstat.options(gpclib=TRUE), unless A is a rectangle. Adrian Baddeley ___ R-sig-Geo mailin

Re: [R-sig-Geo] Spatstat package: help generating random point pattern with different window

2009-10-21 Thread Adrian Baddeley
age: In runif(n) : NAs introduced by coercion If you wanted to generate approximately 10 points, set lambda = 10/area.owin(sp_owin) in the call to rpoispp. If you wanted to generate exactly 10 points, use runifpoint(10, win=sp_owin). Adrian Baddeley

[R-sig-Geo] help using irregular polygons R with spatstat package

2009-10-19 Thread Adrian Baddeley
tstat. nests.ppp <- ppp(nests.points[,1], nests.points[,2], window=boundary.owin) Alternatively you could use the following modified version of 'as.ppp.SpatialPoints' which does behave as you wanted. as.ppp.SpatialPoints <- function (X, W=NULL) { require(spatstat) bb <

Re: [R-sig-Geo] Finding to which Voronoi/Dirichlet a point belongs

2009-10-14 Thread Adrian Baddeley
to each given point of X. Thus, X[i] lies in the tile around nncross(X,Y)$which[i]. Adrian Baddeley ___ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo

[R-sig-Geo] Spatial grid

2009-09-04 Thread Adrian Baddeley
unit area on the sphere, measured locally. This can be plotted as a colour image where 'hot' colours mean higher densities of lightning. You can do this with the function sm.sphere() in the 'sm' package, for example. Adrian Baddeley _

[R-sig-Geo] silly question on quadratcount in spatstat ?

2009-08-23 Thread Adrian Baddeley
k in some versions of spatstat. The safe way to extract the area of each tile in a tessellation is to use 'area.owin' m2 <- unlist(lapply(til, area.owin)) Adrian Baddeley ___ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo

[R-sig-Geo] silly question on quadratcount in spatstat ?

2009-08-23 Thread Adrian Baddeley
he quadrats, quadrat.areas <- unlist(lapply(quadratsH, area.owin)) regards Adrian Baddeley ___ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo

[R-sig-Geo] convert owin object to SpatialPolygons object

2009-05-21 Thread Adrian Baddeley
Tyler Dean Rudolph writes: However the conversion to a Spatial Polygons object does not seem to work To convert an object of class 'owin' (spatstat) to 'SpatialPolygons' (sp) you can use the following cod

[R-sig-Geo] convert owin object to SpatialPolygons object (write buffered MCP to shapefile)

2009-05-19 Thread Adrian Baddeley
se the function 'ripras'. In spatstat 1.15-3 and later, you can control the enlargement factor. Adrian Baddeley ___ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo

[R-sig-Geo] clump of binary pixels (connected components)

2009-05-13 Thread Adrian Baddeley
ion 1.15-3) thanks to Julian Burgos. The command name is 'connected'. Timing is roughly 1 second per megapixel (e.g. 0.25 seconds for a 512 x 512 image). Adrian Baddeley ___ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch https://stat.ethz

[R-sig-Geo] Interpolation / smoothing of points (without raster grids)

2009-05-12 Thread Adrian Baddeley
ensityatpoints' that does this. It will be released in a day or two. Adrian Baddeley ___ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo

[R-sig-Geo] Converting Tessellation objects into shape files

2009-04-19 Thread Adrian Baddeley
u can then output as a shapefile. (This only works if the tessellation is made of polygons or rectangles.) Adrian Baddeley - require(spatstat) require(sp) # convert spatstat objects to sp classes owi

[R-sig-Geo] distance map from raster class

2009-04-16 Thread Adrian Baddeley
all pixels which have the pixel value 1 in my.image. Adrian Baddeley ___ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo

[R-sig-Geo] distance map from raster class

2009-04-16 Thread Adrian Baddeley
ge to an owin object using as.owin() and then apply distmap. In your example, type my.distmap <- distmap(as.owin(my.image)) If you want the opposite, use complement.owin regards Adrian Baddeley ___ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.

Re: [R-sig-Geo] convert spatstat owin-object to splancs

2009-04-08 Thread Adrian Baddeley
function(p) { Polygon(coords=closering(cbind(p$x,p$y)), hole=is.hole.xypolygon(p)) }) whole <- Polygons(pieces, "1") SpatialPolygons(list(whole)) } regards Adrian Baddeley ___ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo

[R-sig-Geo] minimum distance between polygons' edges

2009-03-05 Thread Adrian Baddeley
distance between their endpoints. So the other solutions which have been suggested will not give the correct answer. Adrian Baddeley ___ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo

[R-sig-Geo] Point pattern analysis

2009-02-17 Thread Adrian Baddeley
Spatial-Point-Patterns-in-R.html> which contains a detailed description of how to analyse such data in the package 'spatstat' using both exploratory tools and formal statistical models. Someone else Adrian Baddeley ___ R-sig-

[R-sig-Geo] spatial point patterns - Notes

2008-11-06 Thread Adrian Baddeley
Hi all The tutorial/workshop on 'Analysing spatial point patterns in R' available at has now been revised, rewritten and updated for the current version of spatstat. Adrian Baddeley ___ R-sig-Geo mailing list R-sig-Geo@stat.math.eth

[R-sig-Geo] plotting Ripley fonctions

2008-10-13 Thread Adrian Baddeley
re critical bands for a test of the hypothesis of a completely random pattern. Adrian Baddeley co-author of spatstat www.spatstat.org ___ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo

[R-sig-Geo] (no subject)

2007-03-14 Thread Adrian Baddeley
gt; (Is there something better?) There is nothing better than spatstat! %^] regards Adrian Baddeley ___ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Re: [R-sig-Geo] Identifying overlapping polygons

2007-02-11 Thread Adrian Baddeley
win) for details of the format. Hope that helps Adrian Baddeley ___ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo

[R-sig-Geo] Can you query points with a polygon?

2006-12-13 Thread Adrian Baddeley
into a point pattern object, e.g. A <- ppp(x, y, range(x), range(y)) then simply B <- A[W] gets you the sub-pattern of points lying inside W. This requires spatstat 1.10-2 or later. Adrian Baddeley ___ R-sig-Geo mailing list R-sig-Geo

Re: [R-sig-Geo] Help with the Kmeasure function from the Spatstat package

2006-12-08 Thread Adrian Baddeley
Roger, thank you for those informative comments. I agree entirely. Thanks for the good suggestion about envelope() in spatstat. We will discuss this with the authors of the boot package. Adrian ___ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch h

[R-sig-Geo] Help with the Kmeasure function from the Spatstat package

2006-12-07 Thread Adrian Baddeley
opriate for, choosing the bandwidth for `Kmeasure'. I guess you could use it as a ballpark figure / starting value to play around with. In general terms, spatstat is by far the largest and most extensive R package for analysing spatial point patterns. The writer's r

[R-sig-Geo] Help with the Kmeasure function from the Spatstat package

2006-12-06 Thread Adrian Baddeley
mage probably means that sigma was too small, while a completely flat image means that sigma was too large. The value of sigma reflects an implicit assumption about the `scale' of interesting features in the pattern. If you don't know what features you are looking for, try different scales. Adr

[R-sig-Geo] Problem in converting SpatialPolygonsDataFrame to owin object

2006-09-14 Thread Adrian Baddeley
lib. Alternatively you can convert each separate polygon to an `owin' object, then use 'union.owin' to compute their union (which is doen by converting the polygons to binary images). Adrian Baddeley ___ R-sig-Geo mailing list R-sig-Geo@

[R-sig-Geo] [R] how do we sample in spatial statistics?

2006-07-04 Thread Adrian Baddeley
sam <- temperature[samplepoints] creates an image called 'temperature', then generates a stratified random pattern of points, and extracts the ocean temperatures at these points. Adrian Baddeley ___ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo

[R-sig-Geo] distance calculation; meuse.grid

2006-07-03 Thread Adrian Baddeley
el image (window object, class "owin", type "mask") The return value is a pixel image; the brightness value of each pixel gives the shortest distance from that pixel to the target object. You can display the pixel image, extract the values at chosen locations using the sub

Re: [R-sig-Geo] testing for CSR based on F and G functions

2006-06-21 Thread Adrian Baddeley
eq(0, 0.3, length=100) FminG(cells, r=rvalues) You can do the same thing with envelope(), e.g. envelope(cells, FminG, r=rvalues, global=TRUE) regards Adrian Baddeley ___ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo

[R-sig-Geo] quadrat counting

2006-06-20 Thread Adrian Baddeley
tile boundaries, the observed and expected counts, and the Pearson residuals. quadrat.test() will also perform a chi-squared test of a non-uniform Poisson model. regards Adrian Baddeley ___ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo

[R-sig-Geo] testing for CSR based on F and G functions

2006-06-20 Thread Adrian Baddeley
significance level (nrank/(nsim+1)), the interval of r values over which the maximum absolute deviation is taken (ginterval) and the method of simulating from the null hypothesis (simulate). regards Adrian Baddeley ___ R-sig-Geo mailing list R-si

[R-sig-Geo] Computing polygon area with decimal degree coordinates

2006-06-01 Thread Adrian Baddeley
delineated by an edge and the two meridians that stretch from the edge's endpoints to the south pole. Sum these areas (with the appropriate sign) and we get the polygon area. [Other choices of baseline can be used if you only have a local coordinat

[R-sig-Geo] R-sig-Geo Digest, Vol 30, Issue 6

2006-02-12 Thread Adrian Baddeley
oroidal wrapping is needed, and this function works even if X has a non-rectangular window. The point pattern M is just the restriction of 'mydata' to the same eroded window, so that comparisons of the Kcross values are meaningful. This will become easier in spatstat 1.9. HTH

[R-sig-Geo] spatstat.org

2005-10-18 Thread Adrian Baddeley
Please be advised that the home page for 'spatstat' has moved to www.spatstat.org --- Adrian Baddeley ___ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo

[R-sig-Geo] Generating random points

2005-09-14 Thread Adrian Baddeley
runifpoint Generate N Uniform Random Points rpoispp Generate Poisson Point Pattern stratrand Stratified random point pattern Adrian Baddeley ___ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch https://stat.ethz

[R-sig-Geo] Grids clipped with polygon

2005-08-03 Thread Adrian Baddeley
ise order without repetition) then the following will work library(spatstat) g <- ppp(xg,yg, range(xg), range(yg)) w <- owin(poly=list(x=xp,y=yp)) gsub <- g[ , w] Then gsub consists of the grid points within the polygon. The coordinates can be extracted as gsub$x and gs