Last chance! 50% off unlimited learning
Sale ends in
"pixellate"(x, W=NULL, ..., weights = NULL, what=c("length", "number"))
"psp"
).
"owin"
) determining
the pixel resolution.
as.mask
to determine
the pixel resolution.
what="length"
, the default)
or the total number of segments intersecting each pixel
(what="number"
).
"im"
) with numeric values.
pixellate
for the class of line segment patterns. The pixel raster is determined by W
and the optional arguments ...
.
If W
is missing or NULL
, it defaults to the window
containing x
.
Then W
is converted to a
binary pixel mask using as.mask
. The arguments
...
are passed to as.mask
to
control the pixel resolution.
If weights
are given, then the length of the intersection
between line segment i
and pixel j
is multiplied by
weights[i]
before the lengths are summed for each pixel.
pixellate
,
as.mask
,
as.mask.psp
.
Use as.mask.psp
if you only want to know
which pixels are intersected by lines.
X <- psp(runif(10),runif(10), runif(10), runif(10), window=owin())
plot(pixellate(X))
plot(X, add=TRUE)
sum(lengths.psp(X))
sum(pixellate(X))
plot(pixellate(X, what="n"))
Run the code above in your browser using DataLab