onePerCell: Function to get a dataframe per cell out of your mesh, spots,...

View source: R/helperfunctions.R

onePerCellR Documentation

Function to get a dataframe per cell out of your mesh, spots, object or tiff dataset. onePerCell() returns a dataframe with one table per cell, simplified especially for people who wish to make their own plots (e.g. histograms, etc) based on the summarized cell data. Automatically, it groups the input dataset by unique cell (cell & frame), but it is possible to use this function with other column names.

Description

Function to get a dataframe per cell out of your mesh, spots, object or tiff dataset.

onePerCell() returns a dataframe with one table per cell, simplified especially for people who wish to make their own plots (e.g. histograms, etc) based on the summarized cell data. Automatically, it groups the input dataset by unique cell (cell & frame), but it is possible to use this function with other column names.

Usage

onePerCell(inputframe, by = c("cell", "frame"))

Arguments

inputframe

the dataset (in form of a dataframe) to be summarized

by

the grouping value. default = c("cell", "frame")

Value

the function will return a dataframe (tibble) with the data summarized by the grouping value by. it will do this by returning the common values per cell (mean intensity, etc), removing values that are useless in one-column context (x/y coordinates of outlines), and calculating the mean, median and standard deviation of numerical values it doesn't recognize. if there are character values with different values per grouped variable, the function will take ONLY THE FIRST VARIABLE.

Examples

## Not run: 
df <- data.frame("cell"= c(rep(1, 5), rep(2,5)), "frame"=rep(1, 10), "channel"="GFP", "intensity"=c(1,3,4,5,6,1,2,7,3,10))

onePerCell(df)

## End(Not run)

vrrenske/shinyspots documentation built on Oct. 28, 2023, 12:26 p.m.