40  groupedHyperframe

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/.

TipExamples in Chapter 40 Require
library(groupedHyperframe)

Chapter 40 outlines the S3 methods currently not planned for the class 'groupedHyperframe' (Chapter 15).

40.1 Use groupedHyperframe as grouped_ppp() input

Listing 40.1 creates a grouped hyper data frame lung_g2 which retains the \(x\)- and \(y\)-coords,

Listing 40.1: Example: lung_g2 retaining \(x\)- and \(y\)-coords
lung_g2 = wrobel_lung |>
  within.data.frame(expr = {
    dapi = NULL
  }) |>
  aggregate2hyper(by = ~ patient_id/image_id)
lung_g2
Grouped Hyper Data Frame: ~patient_id

3 patient_id

            image_id    patient_id gender age         x         y     hladr
1  [36953,13765].im3 #03 2-080-378      M  84 (numeric) (numeric) (numeric)
2  [39206,15250].im3 #03 2-080-378      M  84 (numeric) (numeric) (numeric)
3  [40242,17359].im3 #03 2-080-378      M  84 (numeric) (numeric) (numeric)
4  [40863,16444].im3 #03 2-080-378      M  84 (numeric) (numeric) (numeric)
5  [40864,18015].im3 #01 0-889-121      F  85 (numeric) (numeric) (numeric)
6  [41191,13764].im3 #03 2-080-378      M  84 (numeric) (numeric) (numeric)
7  [42689,19214].im3 #01 0-889-121      F  85 (numeric) (numeric) (numeric)
8  [42806,16718].im3 #01 0-889-121      F  85 (numeric) (numeric) (numeric)
9  [44311,17766].im3 #01 0-889-121      F  85 (numeric) (numeric) (numeric)
10 [45366,16647].im3 #01 0-889-121      F  85 (numeric) (numeric) (numeric)
11 [56576,16907].im3 #02 1-037-393      M  66 (numeric) (numeric) (numeric)
12 [56583,15235].im3 #02 1-037-393      M  66 (numeric) (numeric) (numeric)
13 [57130,16082].im3 #02 1-037-393      M  66 (numeric) (numeric) (numeric)
14 [57396,17896].im3 #02 1-037-393      M  66 (numeric) (numeric) (numeric)
15 [57403,16934].im3 #02 1-037-393      M  66 (numeric) (numeric) (numeric)
   phenotype        OS
1   (factor) (numeric)
2   (factor) (numeric)
3   (factor) (numeric)
4   (factor) (numeric)
5   (factor) (numeric)
6   (factor) (numeric)
7   (factor) (numeric)
8   (factor) (numeric)
9   (factor) (numeric)
10  (factor) (numeric)
11  (factor) (numeric)
12  (factor) (numeric)
13  (factor) (numeric)
14  (factor) (numeric)
15  (factor) (numeric)

A curious reader may wonder, is it possible to create a grouped hyper data frame with ppp-hypercolumn(s), from a grouped hyper data frame? In other words, can we convert the grouped hyper data frame lung_g2 into something similar to the grouped hyper data frame s (Chapter 3)? Unfortunately, the author does not implement such functionality for package groupedHyperframe (v0.4.0, GPL-2).