as.data.frame.SegmentedCells: as.data.frame

Description Usage Arguments Value

View source: R/segmentedCells-class.R

Description

Function to coerce a SegmentedCells object to a data frame.

Usage

1
2
## S3 method for class 'SegmentedCells'
as.data.frame(x, ...)

Arguments

x

A SegmentedCells object.

...

Other arguments.

Value

A data.frame

## Generate toy data set.seed(51773) x <- round(c(runif(200),runif(200)+1,runif(200)+2,runif(200)+3, runif(200)+3,runif(200)+2,runif(200)+1,runif(200)),4) y <- round(c(runif(200),runif(200)+1,runif(200)+2,runif(200)+3, runif(200),runif(200)+1,runif(200)+2,runif(200)+3),4) cellType <- factor(paste('c',rep(rep(c(1:2),rep(200,2)),4),sep = ”)) imageID <- rep(c('s1', 's2'),c(800,800)) cells <- data.frame(x, y, cellType, imageID)

## Store data in SegmentedCells object cellExp <- SegmentedCells(cells, cellTypeString = 'cellType')

## Generate LISA cellsDF <- as.data.frame(cellExp)

NULL


spicyR documentation built on March 17, 2021, 6:01 p.m.