Package {groupedHyperframe}


Type: Package
Title: Grouped Hyper Data Frame
Version: 0.4.1
Date: 2026-05-19
Description: To aggregate a hyper data frame, defined in the package 'spatstat.geom', according to a grouping structure. To facilitate downstream analysis based on a "grouped" hyper data frame.
LazyData: true
LazyDataCompression: xz
Encoding: UTF-8
License: GPL-2
Language: en-US
URL: https://github.com/tingtingzhan/groupedHyperframe
Depends: R (≥ 4.6)
Imports: cli, spatstat.geom
Suggests: survival, spatstat.data
Config/roxygen2/version: 8.0.0
Config/roxygen2/markdown: TRUE
NeedsCompilation: no
Packaged: 2026-05-19 10:30:31 UTC; tingtingzhan
Author: Tingting Zhan ORCID iD [aut, cre]
Maintainer: Tingting Zhan <tingtingzhan@gmail.com>
Repository: CRAN
Date/Publication: 2026-05-19 21:20:12 UTC

groupedHyperframe: Grouped Hyper Data Frame

Description

To aggregate a hyper data frame, defined in the package 'spatstat.geom', according to a grouping structure. To facilitate downstream analysis based on a "grouped" hyper data frame.

Author(s)

Maintainer: Tingting Zhan tingtingzhan@gmail.com (ORCID)

Authors:

See Also

Useful links:


Ki67 Data

Description

Ki67 cell data containing 622 patients.

Usage

Ki67

Format

patientID

factor, unique patient identifier

tissueID

factor, TMA core identifier

PFS

Surv, recurrence

logKi67

double, log-transformed cell signal intensity of the protein immunofloerscence signal

age

integer, age at diagnosis

Tstage

integer, tumor stage

node

factor, node stage

HR

logical, hormone positive status

histology

integer, histology grade

Her2

logical, Her2 status

race

character, race, White, Black, Asian, Native Hawaiian or Other Pacific Islander, American Indian or Alaska Native, Unknown

adj_chemo

logical, whether completed adjuvant chemo treatment

adj_rad

integer, adjuvant radiation treatment, 0 = unknown, 1 = done, 2 = NOT done


Aggregate Hyper Data Frame

Description

To aggregate a hyperframe.

Usage

## S3 method for class 'hyperframe'
aggregate(x, by, ...)

Arguments

x

hyperframe

by

two-sided formula, whose right-hand-side contains only the regular-column names of the input x

...

additional parameters of the function aggregate.data.frame, except for simplify

Value

The S3 method aggregate.hyperframe() returns a hyperframe.


Aggregate, an Alternative formula-Interface

Description

An alternative aggregation function with a formula-interface, to avoid the cbind-operation in the function aggregate.formula.

Usage

aggregate2(data, by, ...)

Arguments

data

a data.frame

by

a two-sided formula

...

additional parameters of the function aggregate.data.frame, except for simplify

Details

The cbind-operation in the function aggregate.formula messes up with column(s) that are

factor

and treat them as integer

Surv

and treat them as matrix

The function aggregate.data.frame only accepts a list of factors for the parameter by.

Therefore, the function aggregate2() is created to take care of the factor and Surv columns of the input, with a formula-interface.

Value

The function aggregate2() returns a data.frame.

Note

The function aggregate.data.frame is the workhorse of the function aggregate.formula.

The function as.hyperframe.data.frame is designed to handle the list-columns returned by the function aggregate.


Handy FUNctions for aggregate

Description

Handy functions to be passed to the parameter FUN of the function aggregate and/or aggregate2().

Usage

unique_or_identity(x)

Arguments

x

an R object

Value

The function unique_or_identity() returns an R object.


Convert R Object to vectorlist

Description

Convert R Object to vectorlist

Usage

as.vectorlist(x, ...)

Arguments

x

a list

...

additional parameters of the function is.vectorlist()

Value

The function as.vectorlist() returns an R object of S3 class 'vectorlist'.

Examples

list(rnorm(6L), rnorm(6L)) |>
 as.vectorlist()


Augment Hypercolumn(s) for gam

Description

Augment all numeric vector hypercolumns in a hyperframe for gam.

Usage

aug4gam(x, ...)

## S3 method for class 'data.frame'
aug4gam(x, ...)

## S3 method for class 'hyperframe'
aug4gam(x, ...)

## S3 method for class 'vectorlist'
aug4gam(x, ...)

Arguments

x

see Usage

...

additional parameters, currently of no use

Value

The S3 generic function aug4gam() returns a data.frame.

Author(s)

Tingting Zhan, Erjia Cui


Defunct Functions

Description

The functions mentioned in hard-copy journals, but later .Defunct.

Usage

aggregate_quantile(...)

Arguments

...

Defunct parameters

Value

The .Defunct functions do not have a returned value.


Vector-List

Description

To determine if an R object is a list of vectors with the same storage.mode, length and attributes.

Usage

is.vectorlist(
  x,
  mode = c("logical", "integer", "numeric", "double", "character")
)

Arguments

x

a listof

mode

character scalar other than 'any', 'complex' and 'raw', see the function is.vector

Value

The function is.vectorlist() returns a logical scalar.

Examples

spatstat.data::Kovesi$values |>
 is.vectorlist(mode = 'character') |>
 stopifnot()
spatstat.data::Kovesi$values |>
 is.vectorlist(mode = 'numeric')

Hyper Data Frame with One-and-Only-One ppp-Hyper Column

Description

To create a hyper data frame with one-and-only-one ppp-hyper column.

Usage

pppBy(
  marks,
  coords = ~x + y,
  by,
  data,
  window = owin(xrange = range(.x), yrange = range(.y)),
  ...
)

Arguments

marks

one-sided formula, e.g., ~ m1+m2, where m_i's are one or more marks

coords

one-sided formula, variable names of the x- and y-coordinates in data. Default value is ~x+y.

by

two-sided formula

data

data.frame

window

observation window owin, default value is the x- and y-span of coords in data.

...

additional parameters of the function ppp

Value

The function pppBy() returns a hyper data frame with one-and-only-one ppp-hyper column.


wrobel_lung

Description

From Dr. Julia Wrobel's data https://sph.emory.edu/profile/faculty/julia-wrobel.

Usage

wrobel_lung

Format

A data.frame