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

TipExamples in Chapter 57 Require
library(groupedHyperframe)

Chapter 57 outlines the S3 methods currently not planned for the class 'groupedHyperframe' (Chapter 25).

57.1 Use groupedHyperframe as grouped_ppp() input

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

Listing 57.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)
# Hypercolumn(s) x, y, hladr, phenotype created!
Listing 57.2: Example: lung_g2 retaining \(x\)- and \(y\)-coords
lung_g2
# Grouped Hyper Data Frame: ~patient_id
# 
# 3 patient_id
# 
#             image_id    patient_id gender    OS age         x         y     hladr phenotype
# 1  [36953,13765].im3 #03 2-080-378      M   176  84 (numeric) (numeric) (numeric)  (factor)
# 2  [39206,15250].im3 #03 2-080-378      M   176  84 (numeric) (numeric) (numeric)  (factor)
# 3  [40242,17359].im3 #03 2-080-378      M   176  84 (numeric) (numeric) (numeric)  (factor)
# 4  [40863,16444].im3 #03 2-080-378      M   176  84 (numeric) (numeric) (numeric)  (factor)
# 5  [40864,18015].im3 #01 0-889-121      F 3488+  85 (numeric) (numeric) (numeric)  (factor)
# ✂️ --- output truncated --- ✂️

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 (Section 3.1)? Unfortunately, the author does not implement such functionality for package groupedHyperframe (v0.4.0, GPL-2).