R/int.R

unsimplify <- \(x) {
  # survival::Surv is.matrix
  # survival::Surv does **not** inherits from matrix :)
  if (!inherits(x, what = 'matrix')) return(x)
  x |> 
    asplit(MARGIN = 1L, drop = TRUE)
  # i.e., `simplify = TRUE` for Surv column,
  # but un-simplify for 'matrix'
}

Try the groupedHyperframe package in your browser

Any scripts or data that you put into this service are public.

groupedHyperframe documentation built on June 21, 2026, 5:11 p.m.