42  tess

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 a basis for research grant applications,
  • 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 tess() (v3.7.3, GPL (>= 2)) creates a tessellation, i.e., an R object of S3 class 'tess'.

The S3 generic function as.tess() (v3.7.3, GPL (>= 2)) converts R objects of various classes into a tessellation. Listing 42.1 summarizes the S3 methods for the generic function as.tess() in the spatstat.* family of packages,

Listing 42.1: S3 methods spatstat.*::as.tess.*
Code
library(spatstat)
.S3methods(generic.function = 'as.tess', all.names = TRUE) |> 
  attr(which = 'info', exact = TRUE) |>
  subset.data.frame(subset = grepl(pattern = '^spatstat\\.', x = from))
#                      visible             from generic  isS4
# as.tess.im              TRUE    spatstat.geom as.tess FALSE
# as.tess.list            TRUE    spatstat.geom as.tess FALSE
# as.tess.owin            TRUE    spatstat.geom as.tess FALSE
# as.tess.quadratcount    TRUE    spatstat.geom as.tess FALSE
# as.tess.quadrattest     TRUE spatstat.explore as.tess FALSE
# as.tess.rppm            TRUE   spatstat.model as.tess FALSE
# as.tess.tess            TRUE    spatstat.geom as.tess FALSE
# as.tess.tessfun         TRUE    spatstat.geom as.tess FALSE

Listing 42.2 summarizes the S3 methods for the class 'tess' in the spatstat.* family of packages,

Listing 42.2: S3 methods spatstat.*::*.tess
Code
library(spatstat)
.S3methods(class = 'tess', all.names = TRUE) |> 
  attr(which = 'info', exact = TRUE) |>
  subset.data.frame(subset = grepl(pattern = '^spatstat\\.', x = from))
#                    visible          from       generic  isS4
# [.tess                TRUE spatstat.geom             [ FALSE
# [<-.tess              TRUE spatstat.geom           [<- FALSE
# affine.tess           TRUE spatstat.geom        affine FALSE
# as.data.frame.tess    TRUE spatstat.geom as.data.frame FALSE
# as.function.tess      TRUE spatstat.geom   as.function FALSE
# as.im.tess            TRUE spatstat.geom         as.im FALSE
# as.owin.tess          TRUE spatstat.geom       as.owin FALSE
# as.tess.tess          TRUE spatstat.geom       as.tess FALSE
# connected.tess        TRUE spatstat.geom     connected FALSE
# domain.tess           TRUE spatstat.geom        domain FALSE
# flipxy.tess           TRUE spatstat.geom        flipxy FALSE
# head.tess             TRUE spatstat.geom          head FALSE
# identify.tess         TRUE spatstat.geom      identify FALSE
# marks.tess            TRUE spatstat.geom         marks FALSE
# marks<-.tess          TRUE spatstat.geom       marks<- FALSE
# mergeTiles.tess       TRUE spatstat.geom    mergeTiles FALSE
# nobjects.tess         TRUE spatstat.geom      nobjects FALSE
# plot.tess             TRUE spatstat.geom          plot FALSE
# print.tess            TRUE spatstat.geom         print FALSE
# reflect.tess          TRUE spatstat.geom       reflect FALSE
# rotate.tess           TRUE spatstat.geom        rotate FALSE
# scalardilate.tess     TRUE spatstat.geom  scalardilate FALSE
# shift.tess            TRUE spatstat.geom         shift FALSE
# summary.tess          TRUE spatstat.geom       summary FALSE
# tail.tess             TRUE spatstat.geom          tail FALSE
# tilenames.tess        TRUE spatstat.geom     tilenames FALSE
# tilenames<-.tess      TRUE spatstat.geom   tilenames<- FALSE
# unitname.tess         TRUE spatstat.geom      unitname FALSE
# unitname<-.tess       TRUE spatstat.geom    unitname<- FALSE
# unmark.tess           TRUE spatstat.geom        unmark FALSE
# unstack.tess          TRUE spatstat.geom       unstack FALSE
# Window.tess           TRUE spatstat.geom        Window FALSE
Note

The examples in Chapter 42 require

library(groupedHyperframe)

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

Table 42.1: S3 methods groupedHyperframe::*.tess (v0.4.0)
visible generic isS4
append_marks<-.tess FALSE groupedHyperframe::`append_marks<-` FALSE
Math.tess FALSE methods::Math FALSE
Summary.tess FALSE methods::Summary FALSE

42.1 Group-Generic of Numeric Mark(s)

42.1.1 Math

The S3 method Math.tess() transforms one or more numeric marks of a tessellation, and returns a tessellation with the transformed marks (Table 36.3).

Listing 42.3 applies the log-transformation on the numeric marks of the tessellation meningitis$kreise (Section 10.18), and plots the original and log-transformed tessellations side-by-side for comparison (Figure 42.1).

Listing 42.3: Example: log-transformation on tessellation marks
par(mar = c(0,0,0,0))
spatstat.geom::solist(
  kreise_orig = spatstat.data::meningitis$kreise,
  kreise_log = spatstat.data::meningitis$kreise |> log()
) |>
  spatstat.geom::plot.solist(do.col = TRUE, main = 'meningitis$kreise')
Figure 42.1: meningitis$kreise, original versus log-transformed

Listing 42.4 showcases the exception handling of the log-transformation on the tessellation austates (Section 10.3) without any mark.

Listing 42.4: Exception: log-transformation on tessellation, no mark
spatstat.data::austates |>
  log() |>
  identical(y = spatstat.data::austates) |>
  stopifnot()

42.1.2 Summary

The S3 method Summary.tess() 🚧

42.2 🚧 Append to (Existing) Marks

The S3 method `append_marks<-.tess` (Section 36.8, Table 36.11) 🚧