PositionDataFrame-class {Cardinal} | R Documentation

## PositionDataFrame: data frame with spatial position metadata

### Description

An `PositionDataFrame` is an extension of the `XDataFrame` class with special slot-columns for spatial coordinates. It is designed specifically with biological imaging experiments in mind, so it also has an additional slot-column for tracking the experimental run.

### Usage

    PositionDataFrame(coord, run, ..., row.names = NULL, check.names = TRUE)

### Arguments

`coord` | A `data.frame`-like object containing columns which are spatial coordinates. This will be coerced to a `DataFrame`.
`run` | A `factor` with levels for each experimental run.
`...` | Named arguments that will become columns of the object.
`row.names` | Row names to be assigned to the object; no row names are assigned if this is `NULL`.
`check.names` | Should the column names be checked for syntactic validity?

### Details

`PositionDataFrame` is designed for spatial data, specifically for biological imaging data. It includes a slot-column for the experimental run. In most 2D imaging experiments, each distinct image is considered a distinct run. No additional assumptions are made about the spatial structure of the data, and non-gridded spatial coordinates are allowed.

This class is intended to eventually replace the `IAnnotatedDataFrame` class, and implements similar concepts but with a more robust and modern infrastructure.

### Methods

`run(object)`, `run(object) <- value`:

  Get or set the experimental run slot-column.

`runNames(object)`, `runNames(object) <- value`:

  Get or set the experimental run levels.

`coord(object)`, `coord(object) <- value`:

  Get or set the spatial position slot-columns.

`coordLabels(object)`, `coordLabels(object) <- value`:

  Get or set the names of the spatial position slot-columns.

`gridded(object)`, `gridded(object) <- value`:

  Get or set whether the spatial positions are gridded or not. Typically, this should not be set manually.

`resolution(object)`, `resolution(object) <- value`:

  Get or set the spatial resolution of the spatial positions. Typically, this should not be set manually.

`dims(object)`:

  Get the gridded dimensions of the spatial positions (i.e., as if projected to an image raster).

`is3D(object)`:

  Check if the data is 3D or not.

`as.list(x, ..., slots = TRUE)`:

  Coerce the object to a `list`, where the slot-columns are included by default. Use `slots=FALSE` to exclude the slot-columns.

### Author(s)

Kylie A. Bemis

### See Also

`XDataFrame`

### Examples

    ## Create an PositionDataFrame object
    coord <- expand.grid(x=1:3, y=1:3)
    values <- seq_len(nrow(coord))
    pdata <- PositionDataFrame(coord=coord, values=values)

    ## Check the spatial properties
    gridded(pdata)
    resolution(pdata)
    dims(pdata)

[Package Cardinal version 2.8.0 Index]