% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/buildHyperFrame.R
\name{buildHyperFrame}
\alias{buildHyperFrame}
\alias{buildHyperFrame,data.frame-method}
\alias{buildHyperFrame,matrix-method}
\alias{buildHyperFrame,list-method}
\alias{buildHyperFrame,SpatialExperiment-method}
\title{Build a hyperframe containing all point patterns of an experiment.}
\usage{
buildHyperFrame(x, ...)

\S4method{buildHyperFrame}{data.frame}(
  x,
  coordVars,
  imageVars,
  coVars = setdiff(names(x), c(imageVars, coordVars)),
  ...
)

\S4method{buildHyperFrame}{matrix}(x, imageVars, covariates, ...)

\S4method{buildHyperFrame}{list}(
  x,
  coordVars = c("x", "y"),
  covariatesDf = NULL,
  idVar = NULL,
  ...
)

\S4method{buildHyperFrame}{SpatialExperiment}(x, imageVars, coVars, ...)
}
\arguments{
\item{x}{the input object, see methods('buildHyperFrame')}

\item{...}{additional constructor arguments}

\item{coordVars}{Names of coordinates}

\item{imageVars}{A character vector of variables whose unique combinations
define the separate point patterns (images)}

\item{coVars}{Names of event-wise covariates such as gene or cell for each single point}

\item{covariates}{A vector of covariates}

\item{covariatesDf}{A data frame or matrix of covariates}

\item{idVar}{An optional id variable present in covariatesDf, that is matched
with the names of covariatesDf}

\item{matrix}{The input matrix}

\item{list}{A list of matrices or of point patterns of class 'ppp'}
}
\value{
An object of class 'hyperframe' from the 'spatstat.geom' package
}
\description{
Build a spatstat hyperframe with point patterns and metadata.
Matrices, dataframe, lists and SpatialExperiment inputs are accepted.
}
\examples{
data(Yang)
hypYang <- buildHyperFrame(Yang,
    coordVars = c("x", "y"),
    imageVars = c("day", "root", "section")
)
}
