The S3 generic function as.groupedHyperframe() converts objects of various classes into a grouped hyper data frame (groupedHyperframe, Chapter 19). Package groupedHyperframe (v0.3.2) implements the following S3 methods (Table 14.2),
The S3 method as.groupedHyperframe.data.frame() converts a data frame with substantial amount of duplicated information into a grouped hyper data frame. The example in Chapter 2, Listing 2.1, Listing 2.2,
inspects the input data frame lung0 by the user-specified (nested) grouping structure, e.g., image_id nested in patient_id;
identifies the input data.frame column(s) with non-identical elements within the lowest group, e.g., the numeric column lung0$hladr and the factor column lung0$phenotype;
converts these column(s) into the hypercolumn(s) of the output groupedHyperframe, e.g., the numeric-hypercolumn lung_g$hladr and the factor-hypercolumn lung_g$phenotype. Each row of the output groupedHyperframe represents the lowest group of the nested grouping structure.