library(groupedHyperframe)21 fvlist from anylist
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 examples in Chapter 21 require
Package groupedHyperframe (v0.4.0, GPL-2) defines a derived S3 class 'fvlist' for a list of function-value-tables (fv.object, Chapter 20) that shares several common features (Section 21.2). The S3 class 'fvlist' inherits from the class 'anylist' (Chapter 15), 'listof' and 'list' and is assigned with additional attributes (Listing 21.4),
attr(,'r'), anumericvector, the values of the \(r\)-vector;attr(,'.x'), acharacterscalar, the name of the function argument;attr(,'.y'), acharacterscalar, the name of the recommended-function-value;attr(,'fname'), acharacterscalar orvector, the function name (and additional information);attr(,'rmax'), anumericscalar, the minimum Legal \(r_\text{max}\) (Section 20.5) of allfv.objects, which is obviously<= max(attr(,'r')).
Table 21.1 summarizes the S3 methods for the class 'fvlist' in package groupedHyperframe (v0.4.0, GPL-2),
S3 methods groupedHyperframe::*.fvlist (v0.4.0)
| visible | generic | isS4 | |
|---|---|---|---|
as.list.fvlist |
FALSE | base::as.list |
FALSE |
print.fvlist |
FALSE | base::print |
FALSE |
21.1 Creation
Listing 21.1 and Listing 21.2 show that the point-patterns anemones (Section 10.1) and longleaf (Section 10.17) have similar default \(r_\text{max}\) (Section 36.9) for function markcorr() (Table 36.14),
anemones for markcorr()
spatstat.data::anemones |>
.rmax(fun = 'K')
# [1] 45longleaf for markcorr()
spatstat.data::longleaf |>
.rmax(fun = 'K')
# [1] 50The function as.fvlist() converts a listof fv.objects, that passes the validity check (Section 21.2, Table 21.2), to an object of S3 class 'fvlist'. Listing 21.3 creates a function-value-table list fvL from the conditional mean \(E(r)\) of the point-patterns anemones (Section 10.1) and longleaf (Section 10.17). The S3 method print.fvlist() prints the vital information of fvL.
fvL
fvL = spatstat.geom::solist(
anemones = spatstat.data::anemones,
longleaf = spatstat.data::longleaf
) |>
spatstat.geom::anylapply(
FUN = spatstat.explore::Emark,
r = seq.int(from = 0, to = 45, length.out = 513L)
) |>
as.fvlist()
fvL
# An 'fvlist' of 2 fv.objects E(r)
# Name(s): anemones, longleaf
# Available rmax: 45
# Minimum Legal rmax: 45attributes() of S3 class 'fvlist'
Code
fvL |>
attributes()
# $names
# [1] "anemones" "longleaf"
#
# $class
# [1] "fvlist" "anylist" "listof" "list"
#
# $r
# [1] 0.00000000 0.08789062 0.17578125 0.26367188 0.35156250 0.43945312 0.52734375 0.61523438 0.70312500 0.79101562 0.87890625 0.96679688 1.05468750 1.14257812 1.23046875 1.31835938
# [17] 1.40625000 1.49414062 1.58203125 1.66992188 1.75781250 1.84570312 1.93359375 2.02148438 2.10937500 2.19726562 2.28515625 2.37304688 2.46093750 2.54882812 2.63671875 2.72460938
# [33] 2.81250000 2.90039062 2.98828125 3.07617188 3.16406250 3.25195312 3.33984375 3.42773438 3.51562500 3.60351562 3.69140625 3.77929688 3.86718750 3.95507812 4.04296875 4.13085938
# [49] 4.21875000 4.30664062 4.39453125 4.48242188 4.57031250 4.65820312 4.74609375 4.83398438 4.92187500 5.00976562 5.09765625 5.18554688 5.27343750 5.36132812 5.44921875 5.53710938
# [65] 5.62500000 5.71289062 5.80078125 5.88867188 5.97656250 6.06445312 6.15234375 6.24023438 6.32812500 6.41601562 6.50390625 6.59179688 6.67968750 6.76757812 6.85546875 6.94335938
# [81] 7.03125000 7.11914062 7.20703125 7.29492188 7.38281250 7.47070312 7.55859375 7.64648438 7.73437500 7.82226562 7.91015625 7.99804688 8.08593750 8.17382812 8.26171875 8.34960938
# [97] 8.43750000 8.52539062 8.61328125 8.70117188 8.78906250 8.87695312 8.96484375 9.05273438 9.14062500 9.22851562 9.31640625 9.40429688 9.49218750 9.58007812 9.66796875 9.75585938
# [113] 9.84375000 9.93164062 10.01953125 10.10742188 10.19531250 10.28320312 10.37109375 10.45898438 10.54687500 10.63476562 10.72265625 10.81054688 10.89843750 10.98632812 11.07421875 11.16210938
# [129] 11.25000000 11.33789062 11.42578125 11.51367188 11.60156250 11.68945312 11.77734375 11.86523438 11.95312500 12.04101562 12.12890625 12.21679688 12.30468750 12.39257812 12.48046875 12.56835938
# [145] 12.65625000 12.74414062 12.83203125 12.91992188 13.00781250 13.09570312 13.18359375 13.27148438 13.35937500 13.44726562 13.53515625 13.62304688 13.71093750 13.79882812 13.88671875 13.97460938
# [161] 14.06250000 14.15039062 14.23828125 14.32617188 14.41406250 14.50195312 14.58984375 14.67773438 14.76562500 14.85351562 14.94140625 15.02929688 15.11718750 15.20507812 15.29296875 15.38085938
# [177] 15.46875000 15.55664062 15.64453125 15.73242188 15.82031250 15.90820312 15.99609375 16.08398438 16.17187500 16.25976562 16.34765625 16.43554688 16.52343750 16.61132812 16.69921875 16.78710938
# [193] 16.87500000 16.96289062 17.05078125 17.13867188 17.22656250 17.31445312 17.40234375 17.49023438 17.57812500 17.66601562 17.75390625 17.84179688 17.92968750 18.01757812 18.10546875 18.19335938
# [209] 18.28125000 18.36914062 18.45703125 18.54492188 18.63281250 18.72070312 18.80859375 18.89648438 18.98437500 19.07226562 19.16015625 19.24804688 19.33593750 19.42382812 19.51171875 19.59960938
# [225] 19.68750000 19.77539062 19.86328125 19.95117188 20.03906250 20.12695312 20.21484375 20.30273438 20.39062500 20.47851562 20.56640625 20.65429688 20.74218750 20.83007812 20.91796875 21.00585938
# [241] 21.09375000 21.18164062 21.26953125 21.35742188 21.44531250 21.53320312 21.62109375 21.70898438 21.79687500 21.88476562 21.97265625 22.06054688 22.14843750 22.23632812 22.32421875 22.41210938
# [257] 22.50000000 22.58789062 22.67578125 22.76367188 22.85156250 22.93945312 23.02734375 23.11523438 23.20312500 23.29101562 23.37890625 23.46679688 23.55468750 23.64257812 23.73046875 23.81835938
# [273] 23.90625000 23.99414062 24.08203125 24.16992188 24.25781250 24.34570312 24.43359375 24.52148438 24.60937500 24.69726562 24.78515625 24.87304688 24.96093750 25.04882812 25.13671875 25.22460938
# [289] 25.31250000 25.40039062 25.48828125 25.57617188 25.66406250 25.75195312 25.83984375 25.92773438 26.01562500 26.10351562 26.19140625 26.27929688 26.36718750 26.45507812 26.54296875 26.63085938
# [305] 26.71875000 26.80664062 26.89453125 26.98242188 27.07031250 27.15820312 27.24609375 27.33398438 27.42187500 27.50976562 27.59765625 27.68554688 27.77343750 27.86132812 27.94921875 28.03710938
# [321] 28.12500000 28.21289062 28.30078125 28.38867188 28.47656250 28.56445312 28.65234375 28.74023438 28.82812500 28.91601562 29.00390625 29.09179688 29.17968750 29.26757812 29.35546875 29.44335938
# [337] 29.53125000 29.61914062 29.70703125 29.79492188 29.88281250 29.97070312 30.05859375 30.14648438 30.23437500 30.32226562 30.41015625 30.49804688 30.58593750 30.67382812 30.76171875 30.84960938
# [353] 30.93750000 31.02539062 31.11328125 31.20117188 31.28906250 31.37695312 31.46484375 31.55273438 31.64062500 31.72851562 31.81640625 31.90429688 31.99218750 32.08007812 32.16796875 32.25585938
# [369] 32.34375000 32.43164062 32.51953125 32.60742188 32.69531250 32.78320312 32.87109375 32.95898438 33.04687500 33.13476562 33.22265625 33.31054688 33.39843750 33.48632812 33.57421875 33.66210938
# [385] 33.75000000 33.83789062 33.92578125 34.01367188 34.10156250 34.18945312 34.27734375 34.36523438 34.45312500 34.54101562 34.62890625 34.71679688 34.80468750 34.89257812 34.98046875 35.06835938
# [401] 35.15625000 35.24414062 35.33203125 35.41992188 35.50781250 35.59570312 35.68359375 35.77148438 35.85937500 35.94726562 36.03515625 36.12304688 36.21093750 36.29882812 36.38671875 36.47460938
# [417] 36.56250000 36.65039062 36.73828125 36.82617188 36.91406250 37.00195312 37.08984375 37.17773438 37.26562500 37.35351562 37.44140625 37.52929688 37.61718750 37.70507812 37.79296875 37.88085938
# [433] 37.96875000 38.05664062 38.14453125 38.23242188 38.32031250 38.40820312 38.49609375 38.58398438 38.67187500 38.75976562 38.84765625 38.93554688 39.02343750 39.11132812 39.19921875 39.28710938
# [449] 39.37500000 39.46289062 39.55078125 39.63867188 39.72656250 39.81445312 39.90234375 39.99023438 40.07812500 40.16601562 40.25390625 40.34179688 40.42968750 40.51757812 40.60546875 40.69335938
# [465] 40.78125000 40.86914062 40.95703125 41.04492188 41.13281250 41.22070312 41.30859375 41.39648438 41.48437500 41.57226562 41.66015625 41.74804688 41.83593750 41.92382812 42.01171875 42.09960938
# [481] 42.18750000 42.27539062 42.36328125 42.45117188 42.53906250 42.62695312 42.71484375 42.80273438 42.89062500 42.97851562 43.06640625 43.15429688 43.24218750 43.33007812 43.41796875 43.50585938
# [497] 43.59375000 43.68164062 43.76953125 43.85742188 43.94531250 44.03320312 44.12109375 44.20898438 44.29687500 44.38476562 44.47265625 44.56054688 44.64843750 44.73632812 44.82421875 44.91210938
# [513] 45.00000000
#
# $.x
# [1] "r"
#
# $.y
# [1] "iso"
#
# $fname
# [1] "E"
#
# $rmax
# [1] 4521.2 Validity
The function is.fvlist() requires that all members of the input list of fv.objects (Chapter 20) share certain identical properties (Table 21.2). Some of these properties are also required by the low-level utility function bind.fv() (v3.8.0, GPL (>= 2)).
S3 Class 'fvlist' versus function bind.fv()
Need to be identical? |
S3 Class 'fvlist' |
bind.fv() |
|---|---|---|
| Function Arguments, the \(r\)-vector values | Yes | Yes |
| Name of Function Argument, Table 20.2, Listing 20.6 | Yes | No(?) |
| Name of Recommended-Function-Value, Table 20.2, Listing 20.6 | Yes | No(?) |
Function Name (& Add’l Info), attr(,'fname') |
Yes | No(?) |
Listing 21.5 validates that the function-value-table list fvL (Listing 21.3) is an fvlist.
is.fvlist() (Listing 21.3)
stopifnot(is.fvlist(fvL))21.3 Inheritance
The S3 class 'fvlist' inherits from the class 'anylist' (Chapter 15) (Listing 21.6).
S3 class 'fvlist'
fvL |>
class()
# [1] "fvlist" "anylist" "listof" "list"