24  ppp

ImportantDisclaimer

These packages (Note 1) are a one-person project undergoing rapid evolution. Backward compatibility (per Hadley Wickham) is provided as a courtesy rather than a guarantee.

Until further notice, these packages should

  • not be used as the basis for research grant applications or referenced in final research progress reports,
  • not be cited as an actively maintained tool in a peer-reviewed manuscript,
  • not be used to support or fulfill requirements for pursuing an academic degree.

In addition, work primarily based on these packages (Note 1) should not be presented at academic conferences or similar scholarly venues.

Furthermore, a person’s ability to use these packages (Note 1) does not necessarily imply an understanding of their underlying mechanisms. Accordingly, demonstration of their use alone should not be considered sufficient evidence of expertise, nor should it be credited as a basis for academic promotion or advancement.

These statements do not apply to the contributors (Tip 1) to these packages (Note 1) with respect to their specific contributions.

These statements do not apply when the maintainer of these packages (Note 1), Tingting Zhan, is credited as the first author, the lead author, and/or the corresponding author in a peer-reviewed manuscript, or as the Principal Investigator or Co-Principal Investigator in a research grant application and/or a final research progress report.

These statements are advisory in nature and do not modify or restrict the rights granted under the GNU General Public License https://www.r-project.org/Licenses/.

The function ppp() (v3.7.3, GPL (>= 2)) creates a two-dimensional point-pattern object, i.e., an R object of S3 class 'ppp' (ppp.object). A point-pattern contains the \(x\)- and \(y\)-coordinates in an observation window (owin, Chapter 22) and may contain

The S3 generic function as.ppp() (v3.7.3, GPL (>= 2)) converts R objects of various classes into a point-pattern. Note 24.1 and Note 24.2 summarize the S3 methods for the generic function as.ppp() and the S3 methods for the class 'ppp', respectively, in the spatstat.* family of packages,

S3 methods of spatstat.geom::as.ppp (v3.7.3)
visible from isS4
as.ppp.data.frame TRUE spatstat.geom FALSE
as.ppp.default TRUE spatstat.geom FALSE
as.ppp.influence.ppm TRUE spatstat.model FALSE
as.ppp.lpp TRUE spatstat.linnet FALSE
as.ppp.matrix TRUE spatstat.geom FALSE
as.ppp.NAobject TRUE spatstat.geom FALSE
as.ppp.ppp TRUE spatstat.geom FALSE
as.ppp.psp TRUE spatstat.geom FALSE
as.ppp.quad TRUE spatstat.geom FALSE
as.ppp.ssf TRUE spatstat.explore FALSE
S3 methods *.ppp
visible from generic isS4
[.ppp TRUE spatstat.geom base::[ FALSE
[<-.ppp TRUE spatstat.geom base::`[<-` FALSE
affine.ppp TRUE spatstat.geom spatstat.geom::affine FALSE
anyDuplicated.ppp TRUE spatstat.geom base::anyDuplicated FALSE
as.data.frame.ppp TRUE spatstat.geom base::as.data.frame FALSE
as.im.ppp TRUE spatstat.geom spatstat.geom::as.im FALSE
as.layered.ppp TRUE spatstat.geom spatstat.geom::as.layered FALSE
as.owin.ppp TRUE spatstat.geom spatstat.geom::as.owin FALSE
as.ppp.ppp TRUE spatstat.geom spatstat.geom::as.ppp FALSE
auc.ppp TRUE spatstat.explore spatstat.explore::auc FALSE
berman.test.ppp TRUE spatstat.explore spatstat.explore::berman.test FALSE
boundingbox.ppp TRUE spatstat.geom spatstat.geom::boundingbox FALSE
boundingcentre.ppp TRUE spatstat.geom spatstat.geom::boundingcentre FALSE
boundingcircle.ppp TRUE spatstat.geom spatstat.geom::boundingcircle FALSE
boundingradius.ppp TRUE spatstat.geom spatstat.geom::boundingradius FALSE
bw.abram.ppp TRUE spatstat.explore spatstat.univar::bw.abram FALSE
bw.relrisk.ppp TRUE spatstat.explore spatstat.explore::bw.relrisk FALSE
by.ppp TRUE spatstat.geom base::by FALSE
cdf.test.ppp TRUE spatstat.explore spatstat.explore::cdf.test FALSE
circumradius.ppp TRUE spatstat.geom spatstat.geom::circumradius FALSE
closepairs.ppp TRUE spatstat.geom spatstat.geom::closepairs FALSE
closing.ppp TRUE spatstat.geom spatstat.geom::closing FALSE
connected.ppp TRUE spatstat.geom spatstat.geom::connected FALSE
coords.ppp TRUE spatstat.geom spatstat.geom::coords FALSE
coords<-.ppp TRUE spatstat.geom spatstat.geom::`coords<-` FALSE
coxmap.ppp TRUE spatstat.explore spatstat.explore::coxmap FALSE
crossdist.ppp TRUE spatstat.geom spatstat.geom::crossdist FALSE
crosspairs.ppp TRUE spatstat.geom spatstat.geom::crosspairs FALSE
cut.ppp TRUE spatstat.geom base::cut FALSE
default.symbolmap.ppp TRUE spatstat.geom spatstat.geom::default.symbolmap FALSE
density.ppp TRUE spatstat.explore stats::density FALSE
densityAdaptiveKernel.ppp TRUE spatstat.explore spatstat.univar::densityAdaptiveKernel FALSE
densityfun.ppp TRUE spatstat.explore spatstat.explore::densityfun FALSE
densityHeat.ppp TRUE spatstat.explore spatstat.explore::densityHeat FALSE
densityVoronoi.ppp TRUE spatstat.explore spatstat.explore::densityVoronoi FALSE
dilation.ppp TRUE spatstat.geom spatstat.geom::dilation FALSE
distfun.ppp TRUE spatstat.geom spatstat.geom::distfun FALSE
distmap.ppp TRUE spatstat.geom spatstat.geom::distmap FALSE
domain.ppp TRUE spatstat.geom spatstat.geom::domain FALSE
duplicated.ppp TRUE spatstat.geom base::duplicated FALSE
edit.ppp TRUE spatstat.geom utils::edit FALSE
envelope.ppp TRUE spatstat.explore spatstat.explore::envelope FALSE
erosion.ppp TRUE spatstat.geom spatstat.geom::erosion FALSE
fardist.ppp TRUE spatstat.geom spatstat.geom::fardist FALSE
flipxy.ppp TRUE spatstat.geom spatstat.geom::flipxy FALSE
Frame<-.ppp TRUE spatstat.geom spatstat.geom::`Frame<-` FALSE
has.close.ppp TRUE spatstat.geom spatstat.geom::has.close FALSE
head.ppp TRUE spatstat.geom utils::head FALSE
identify.ppp TRUE spatstat.geom graphics::identify FALSE
intensity.ppp TRUE spatstat.geom spatstat.geom::intensity FALSE
is.connected.ppp TRUE spatstat.geom spatstat.geom::is.connected FALSE
is.empty.ppp TRUE spatstat.geom spatstat.geom::is.empty FALSE
is.marked.ppp TRUE spatstat.geom spatstat.geom::is.marked FALSE
is.multitype.ppp TRUE spatstat.geom spatstat.geom::is.multitype FALSE
kppm.ppp TRUE spatstat.model spatstat.model::kppm FALSE
lurking.ppp TRUE spatstat.model spatstat.model::lurking FALSE
make.simulrecipe.ppp TRUE spatstat.explore spatstat.explore::make.simulrecipe FALSE
markformat.ppp TRUE spatstat.geom spatstat.geom::markformat FALSE
marks.ppp TRUE spatstat.geom spatstat.geom::marks FALSE
marks<-.ppp TRUE spatstat.geom spatstat.geom::`marks<-` FALSE
multiplicity.ppp TRUE spatstat.geom spatstat.geom::multiplicity FALSE
nnclean.ppp TRUE spatstat.explore spatstat.explore::nnclean FALSE
nncross.ppp TRUE spatstat.geom spatstat.geom::nncross FALSE
nndensity.ppp TRUE spatstat.explore spatstat.explore::nndensity FALSE
nndist.ppp TRUE spatstat.geom spatstat.geom::nndist FALSE
nnfun.ppp TRUE spatstat.geom spatstat.geom::nnfun FALSE
nnwhich.ppp TRUE spatstat.geom spatstat.geom::nnwhich FALSE
nobjects.ppp TRUE spatstat.geom spatstat.geom::nobjects FALSE
npoints.ppp TRUE spatstat.geom spatstat.geom::npoints FALSE
opening.ppp TRUE spatstat.geom spatstat.geom::opening FALSE
pairdist.ppp TRUE spatstat.geom spatstat.geom::pairdist FALSE
pcf.ppp TRUE spatstat.explore spatstat.explore::pcf FALSE
periodify.ppp TRUE spatstat.geom spatstat.geom::periodify FALSE
persp.ppp TRUE spatstat.geom graphics::persp FALSE
pixellate.ppp TRUE spatstat.geom spatstat.geom::pixellate FALSE
plot.ppp TRUE spatstat.geom base::plot FALSE
ppm.ppp TRUE spatstat.model spatstat.model::ppm FALSE
print.ppp TRUE spatstat.geom base::print FALSE
quadrat.test.ppp TRUE spatstat.explore spatstat.explore::quadrat.test FALSE
quadratcount.ppp TRUE spatstat.geom spatstat.geom::quadratcount FALSE
quantess.ppp TRUE spatstat.geom spatstat.geom::quantess FALSE
rebound.ppp TRUE spatstat.geom spatstat.geom::rebound FALSE
relevel.ppp TRUE spatstat.geom stats::relevel FALSE
relrisk.ppp TRUE spatstat.explore spatstat.explore::relrisk FALSE
relriskHeat.ppp TRUE spatstat.explore spatstat.explore::relriskHeat FALSE
rescale.ppp TRUE spatstat.geom spatstat.geom::rescale FALSE
resolve.lambda.ppp TRUE spatstat.explore spatstat.explore::resolve.lambda FALSE
resolve.lambdacross.ppp TRUE spatstat.explore spatstat.explore::resolve.lambdacross FALSE
resolve.reciplambda.ppp TRUE spatstat.explore spatstat.explore::resolve.reciplambda FALSE
rexplode.ppp TRUE spatstat.geom spatstat.geom::rexplode FALSE
rhohat.ppp TRUE spatstat.explore spatstat.explore::rhohat FALSE
rjitter.ppp TRUE spatstat.geom spatstat.geom::rjitter FALSE
roc.ppp TRUE spatstat.explore spatstat.explore::roc FALSE
rotate.ppp TRUE spatstat.geom spatstat.geom::rotate FALSE
round.ppp TRUE spatstat.geom base::round FALSE
rounding.ppp TRUE spatstat.geom spatstat.univar::rounding FALSE
rshift.ppp TRUE spatstat.random spatstat.random::rshift FALSE
scalardilate.ppp TRUE spatstat.geom spatstat.geom::scalardilate FALSE
scanmeasure.ppp TRUE spatstat.explore spatstat.explore::scanmeasure FALSE
sdr.ppp TRUE spatstat.explore spatstat.explore::sdr FALSE
segregation.test.ppp TRUE spatstat.explore spatstat.explore::segregation.test FALSE
sharpen.ppp TRUE spatstat.explore spatstat.explore::sharpen FALSE
shift.ppp TRUE spatstat.geom spatstat.geom::shift FALSE
Smooth.ppp TRUE spatstat.explore spatstat.explore::Smooth FALSE
Smoothfun.ppp TRUE spatstat.explore spatstat.explore::Smoothfun FALSE
SmoothHeat.ppp TRUE spatstat.explore spatstat.explore::SmoothHeat FALSE
spatialCovariateEvidence.ppp TRUE spatstat.explore spatstat.explore::spatialCovariateEvidence FALSE
SpatialMedian.ppp TRUE spatstat.explore spatstat.explore::SpatialMedian FALSE
SpatialQuantile.ppp TRUE spatstat.explore spatstat.explore::SpatialQuantile FALSE
split.ppp TRUE spatstat.geom base::split FALSE
split<-.ppp TRUE spatstat.geom base::`split<-` FALSE
subset.ppp TRUE spatstat.geom base::subset FALSE
summary.ppp TRUE spatstat.geom base::summary FALSE
superimpose.ppp TRUE spatstat.geom spatstat.geom::superimpose FALSE
tail.ppp TRUE spatstat.geom utils::tail FALSE
text.ppp TRUE spatstat.geom graphics::text FALSE
unique.ppp TRUE spatstat.geom base::unique FALSE
uniquemap.ppp TRUE spatstat.geom spatstat.univar::uniquemap FALSE
unitname.ppp TRUE spatstat.geom spatstat.geom::unitname FALSE
unitname<-.ppp TRUE spatstat.geom spatstat.geom::`unitname<-` FALSE
unmark.ppp TRUE spatstat.geom spatstat.geom::unmark FALSE
unstack.ppp TRUE spatstat.geom utils::unstack FALSE
Window.ppp TRUE spatstat.geom spatstat.geom::Window FALSE
Window<-.ppp TRUE spatstat.geom spatstat.geom::`Window<-` FALSE
TipExamples in Chapter 24 Require
library(groupedHyperframe)

Table 24.1 summarizes the S3 methods for the class 'ppp' in package groupedHyperframe (v0.4.0, GPL-2),

Table 24.1: S3 methods groupedHyperframe::*.ppp (v0.4.0)
visible generic isS4
is.numeric.ppp FALSE base::is.numeric FALSE
Math.ppp FALSE methods::Math FALSE
na.exclude.ppp FALSE stats::na.exclude FALSE
na.omit.ppp FALSE stats::na.omit FALSE
quantile.ppp FALSE stats::quantile FALSE
Summary.ppp FALSE methods::Summary FALSE

24.1 Missing Marks Handling

The S3 methods na.omit.ppp() and na.exclude.ppp() omits and excludes, respectively, the missing marks from a point-pattern. Both functions return a point-pattern.

If missingness exists in the marks, the 'na.action'-attribute of the marks is saved as an attribute of the returned point-pattern.

Listing 24.1: Exception: functions na.omit.ppp() and na.exclude.ppp() on 'none' mark-format
spatstat.data::vesicles |>
  na.omit() |>
  identical(y = spatstat.data::vesicles) |>
  stopifnot()
spatstat.data::vesicles |>
  na.exclude()|>
  identical(y = spatstat.data::vesicles) |>
  stopifnot()
Listing 24.2: Exception: functions na.omit.ppp() and na.exclude.ppp() on 'vector' mark-format, no missingness
spatstat.data::ants |>
  na.omit() |>
  identical(y = spatstat.data::ants) |>
  stopifnot()
spatstat.data::ants |>
  na.exclude() |>
  identical(y = spatstat.data::ants) |>
  stopifnot()
Listing 24.3: Example: functions na.omit.ppp() and na.exclude.ppp() on 'dataframe' mark-format
nbfires_omit = spatstat.data::nbfires |> 
  na.omit() 
nbfires_exclude = spatstat.data::nbfires |> 
  na.exclude()
list(
  nbfires = spatstat.data::nbfires,
  omit = nbfires_omit, 
  exclude = nbfires_exclude
) |> 
  vapply(FUN = spatstat.geom::npoints.ppp, FUN.VALUE = NA_integer_)
nbfires    omit exclude 
   7108    6989    6989 
list(
  omit = nbfires_omit,
  exclude = nbfires_exclude
) |> 
  vapply(FUN = \(i) {
    i |>
      attr(which = 'na.action', exact = TRUE) |> 
      attr(which = 'class', exact = TRUE)
  }, FUN.VALUE = NA_character_)
     omit   exclude 
   "omit" "exclude" 

Note that the function ppp() (v3.7.3, GPL (>= 2)) already removes missing \(x\)- and \(y\)-coords in the creation of a point-pattern.

Note that the S3 method plot.ppp() (v3.7.3, GPL (>= 2)) also removes missing marks (email with Dr. Baddeley, 2025-01-07).

24.2 Are Marks Numeric?

The S3 method is.numeric.ppp() determines whether each of the marks, if any, in a point-pattern are numeric.

Listing 24.4: Exception: function is.numeric.ppp() on 'none' mark-format
spatstat.data::vesicles |>
  is.numeric()
logical(0)
Listing 24.5: Example: function is.numeric.ppp() on numeric mark
spatstat.data::longleaf |>
  is.numeric()
[1] TRUE
Listing 24.6: Example: function is.numeric.ppp() on multi-type mark
spatstat.data::ants |>
  is.numeric()
[1] FALSE

The S3 methods is.numeric.ppp() and is.multitype.ppp() (v3.7.3, GPL (>= 2)) behave differently for a point-pattern with 'dataframe' mark-format, e.g., betacells (Section 9.4).

Listing 24.7: Review: function is.multitype.ppp() on 'dataframe' mark-format
spatstat.data::betacells |>
  spatstat.geom::is.multitype.ppp()
[1] FALSE
Listing 24.8: Example: functions is.numeric.ppp() on 'dataframe' mark-format
spatstat.data::betacells |>
  is.numeric()
 type  area 
FALSE  TRUE 

24.3 Group-Generic of Numeric Mark(s)

24.3.1 Math

Package groupedHyperframe (v0.4.0, GPL-2) implements the following S3 methods (Table 24.2) of the Math-groupGeneric,

Table 24.2: S3 methods of methods::Math (v4.5.3)
visible isS4
Math.ppp FALSE FALSE
Math.psp FALSE FALSE
Math.quosure FALSE FALSE
Math.sparse3Darray FALSE FALSE
Math.tess FALSE FALSE
Math.UUID FALSE FALSE
Math.vctrs_sclr FALSE FALSE
Math.vctrs_vctr FALSE FALSE

The S3 method Math.ppp() transforms one or more numeric marks of a point-pattern, and returns a point-pattern with the transformed marks. The \(x\)- and \(y\)-coordinates and the multi-type marks of the input point-pattern remain unchanged. This function, as well as the S3 method Math.tess() (Section 29.1.1), serves a similar purpose (Table 24.3) to the S3 methods Math.fv() (v3.8.0, GPL (>= 2)) and Math.im() (v3.7.3, GPL (>= 2)).

Table 24.3: Methods in Math Group-Generic
Math.ppp() Math.tess() Math.fv() Math.im()
Input & Output ppp.object (Chapter 24) tessellation (Chapter 29) fv.object im.object (Chapter 18)
Operates On numeric mark(s) numeric mark(s) function-values “grey value” at each pixel
Does Not Alter multi-type marks (if any), \(x\)- and \(y\)-coordinates, observation window, etc. observation window, tiles, etc. function argument, etc. \(x\)- and \(y\)-coordinates, dimension, etc.

Listing 24.9 applies the log-transformations on the point-pattern bronzefilter (Section 9.5) with 'vector' mark-format.

Listing 24.9: Example: log-transformations on 'vector' mark-format
list(
  original = spatstat.data::bronzefilter,
  log = spatstat.data::bronzefilter |> log(),
  log1p = spatstat.data::bronzefilter |> log1p()
) |>
  lapply(FUN = spatstat.geom::summary.ppp) |>
  lapply(FUN = getElement, name = 'marks')
$original
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
  0.013   0.120   0.160   0.167   0.200   0.467 

$log
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
-4.3428 -2.1203 -1.8326 -1.8989 -1.6094 -0.7614 

$log1p
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
0.01292 0.11333 0.14842 0.15244 0.18232 0.38322 

Listing 24.10 applies the log-transformation on the numeric marks in the point-pattern betacells (Section 9.4) with 'dataframe' mark-format.

Listing 24.10: Example: log-transformations on numeric marks in 'dataframe' mark-format
list(
  original = spatstat.data::betacells,
  log = spatstat.data::betacells |> log()
) |>
  lapply(FUN = spatstat.geom::summary.ppp) |>
  lapply(FUN = getElement, name = 'marks')
$original
  type         area      
 off:70   Min.   :168.3  
 on :65   1st Qu.:248.8  
          Median :279.4  
          Mean   :291.2  
          3rd Qu.:324.2  
          Max.   :514.4  

$log
  type         area      
 off:70   Min.   :5.126  
 on :65   1st Qu.:5.517  
          Median :5.633  
          Mean   :5.653  
          3rd Qu.:5.782  
          Max.   :6.243  

Listing 24.11 showcases the exception handling of the log-transformations on the \(x\)- and \(y\)-coordinates-only point-pattern vesicles (Section 9.24).

Listing 24.11: Exception: log-transformations on 'none' mark-format
list(
  spatstat.data::vesicles |> log(),
  spatstat.data::vesicles |> log1p(),
  spatstat.data::vesicles |> log2(),
  spatstat.data::vesicles |> log10()
) |> 
  vapply(FUN = identical, y = spatstat.data::vesicles, FUN.VALUE = NA) |>
  stopifnot()

24.3.2 Summary

Package groupedHyperframe (v0.4.0, GPL-2) implements the following S3 methods (Table 24.4) of the Summary-groupGeneric,

Table 24.4: S3 methods of methods::Summary (v4.5.3)
visible isS4
Summary.ppp FALSE FALSE
Summary.psp FALSE FALSE
Summary.quosure FALSE FALSE
Summary.roman FALSE FALSE
Summary.sparse3Darray FALSE FALSE
Summary.tess FALSE FALSE
Summary.unit FALSE FALSE
Summary.UUID FALSE FALSE
Summary.vctrs_sclr FALSE FALSE
Summary.vctrs_vctr FALSE FALSE
Summary.yearmon FALSE FALSE
Summary.yearqtr FALSE FALSE

The S3 method Summary.ppp() summarizes one or more numeric marks of a point-pattern. This function, as well as the S3 method Summary.tess() (Section 29.1.2), serves a similar purpose (Table 24.5) to the S3 methods Summary.fv() (v3.8.0, GPL (>= 2)) and Summary.im() (v3.7.3, GPL (>= 2)).

Table 24.5: Methods in Summary Group-Generic
Summary.ppp() Summary.tess() Summary.fv() Summary.im()
Input ppp.object (Chapter 24) tessellation (Chapter 29) fv.object im.object (Chapter 18)
Operates On each numeric mark(s) each numeric mark(s) all function-values “grey value” at each pixel

Listing 24.12 and Listing 24.13 find the minimum and the range of the numeric mark in the point-pattern bronzefilter (Section 9.5) with 'vector' mark-format.

Listing 24.12: Example: minimum of numeric marks on 'vector' mark-format
spatstat.data::bronzefilter |>
  min()
[1] 0.013
Listing 24.13: Example: range of numeric marks on 'vector' mark-format
spatstat.data::bronzefilter |>
  range()
[1] 0.013 0.467

Listing 24.14 - Listing 24.17 find the minimum and the range of the numeric mark(s) in the point-patterns betacells (Section 9.4) and finpines (Section 9.11) with 'dataframe' mark-format.

Listing 24.14: Example: minimum of one numeric mark in 'dataframe' mark-format
spatstat.data::betacells |>
  min()
 area 
168.3 
Listing 24.15: Example: range of one numeric mark in 'dataframe' mark-format
spatstat.data::betacells |>
  range()
$area
[1] 168.3 514.4
Listing 24.16: Example: minimum of multiple numeric marks in 'dataframe' mark-format
spatstat.data::finpines |>
  min()
diameter   height 
     0.0      0.8 
Listing 24.17: Example: range of multiple numeric marks in 'dataframe' mark-format
spatstat.data::finpines |>
  range()
$diameter
[1] 0 7

$height
[1] 0.8 5.4

Listing 24.18 showcases the exception handling with an \(x\)- and \(y\)-coordinates-only point-pattern vesicles (Section 9.24).

Listing 24.18: Exception: minimum and range of numeric mark on 'none' mark-format
spatstat.data::vesicles |>
  min() |>
  is.null() |> stopifnot()
spatstat.data::vesicles |>
  range() |>
  is.null() |> stopifnot()

24.4 Quantile of Numeric Mark(s)

Package groupedHyperframe (v0.4.0, GPL-2) implements the following S3 methods (Table 24.6) of the generic function quantile(),

Table 24.6: S3 methods of stats::quantile (v4.5.3)
visible isS4
quantile.default FALSE FALSE
quantile.ecdf FALSE FALSE
quantile.POSIXt FALSE FALSE
quantile.ppp FALSE FALSE
quantile.quosure FALSE FALSE
quantile.vctrs_vctr FALSE FALSE
quantile.zoo FALSE FALSE

The S3 method quantile.ppp() finds the quantiles of one or more numeric marks in a point-pattern. This is completely different from the S3 method SpatialQuantile.ppp() (v3.8.0, GPL (>= 2)).

Listing 24.19 showcases the exception handling for the \(x\)- and \(y\)-coordinates-only point-pattern vesicles (Section 9.24).

Listing 24.19: Exception: function quantile.ppp() on 'none' mark-format
spatstat.data::vesicles |>
  quantile() |>
  is.null() |> stopifnot()

Listing 24.20 showcases the exception handling for the point-pattern ants (Section 9.2) with one multi-type mark.

Listing 24.20: Exception: function quantile.ppp() on multi-type mark in 'vector' mark-format
spatstat.data::ants |>
  quantile() |>
  is.null() |> stopifnot()

Listing 24.21 finds the quantiles of the numeric mark in the point-pattern longleaf (Section 9.17).

Listing 24.21: Example: function quantile.ppp() on numeric mark in 'vector' mark-format
spatstat.data::longleaf |>
  quantile()
    0%    25%    50%    75%   100% 
 2.000  9.100 26.150 42.125 75.900 

Listing 24.22 finds the quantiles of the numeric mark area in the point-pattern betacells (Section 9.4).

Listing 24.22: Example: function quantile.ppp() on numeric mark(s) in 'dataframe' mark-format
spatstat.data::betacells |>
  quantile()
    0%    25%    50%    75%   100% 
168.30 248.85 279.40 324.25 514.40 

Listing 24.23 finds the quantiles of the two numeric marks diameter and height in the point-pattern finpines (Section 9.11).

Listing 24.23: Example: function quantile.ppp() on two numeric marks in 'dataframe' mark-format
spatstat.data::finpines |>
  quantile()
$diameter
  0%  25%  50%  75% 100% 
   0    1    2    3    7 

$height
   0%   25%   50%   75%  100% 
0.800 1.825 2.850 3.600 5.400