RestructureDF: Restructure a dataframe into a list of dataframes

View source: R/main-alt-helpers.R

RestructureDFR Documentation

Restructure a dataframe into a list of dataframes

Description

RestructureDF generates the list of dataframes containing single-cell data where each consecutive member is a dataframe from a different timepoint, from a single dataframe where a column designates the timepoints and if relevant, the conditions, of each individual cell. This function is a pre-processing step before starting a FLOWMAPR analysis using FLOWMAPfromDF as it only accepts single-cell data in a certain format.

Usage

RestructureDF(df, time.col.label = "Time", condition.col.label = NULL)

Arguments

df

a single dataframe containing all single-cell data from all treatments and conditions (if relevant) to be restructured

time.col.label

Character specifying the channel name that should be used to find the timepoint label for each cell, default is set to "Time"

condition.col.label

Character specifying the channel name that should be used to find the condition label for each cell, default is set to NULL

Value

a list of dataframes containing the single-cell data or if condition.col.label is provided (not NULL), a list of lists containing dataframes of single-cell data

Examples

## Not run: df <- read.csv(file = system.file("extdata/csv/single-cell-data.csv",package = "FLOWMAPR"), header = TRUE, sep = ",")
## Not run: RestructureDF(df, time.col.label = "Timepoint", condition.col.label = "Treatment")

zunderlab/FLOWMAP documentation built on Sept. 7, 2024, 6:31 p.m.