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
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
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
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
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
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
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
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 <
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
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
_
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
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
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
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
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
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
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
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
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.
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
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
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-
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
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
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
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
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
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
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
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
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@
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
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
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
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
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
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
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
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
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
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
41 matches
Mail list logo