organizeData {plotGrouper} | R Documentation |
This function will organize a tibble into tidy format and perform count transformations if appropriate columns are specified.
organizeData(data = NULL, exclude = NULL, comp = NULL, comps = NULL, variables = NULL, id = NULL, beadColumn = NULL, dilutionColumn = NULL)
data |
A tibble |
exclude |
A list of columns to exclude from gather |
comp |
the name of comparison column |
comps |
A vector of names of the comparisons |
variables |
A vector of the variables to be plotted |
id |
The name of unique identifier column |
beadColumn |
The column name that has total number of beads/sample |
dilutionColumn |
The column name that has dilution factor for each sample 1/x |
Tibble in tidy format based on columns chosen to be excluded. Count data will be transformed if appropriate columns are present.
iris %>% dplyr::mutate(Species = as.character(Species)) %>% dplyr::group_by(Species) %>% dplyr::mutate(Sample = paste0(Species, "_", dplyr::row_number()), Sheet = "iris") %>% dplyr::select(Sample, Sheet, Species, dplyr::everything()) %>% plotGrouper::organizeData(data = ., exclude = c("Sample", "Sheet", "Species"), comp = "Species", comps = c("setosa", "versicolor", "virginica"), variables = "Sepal.Length", id = "Sample", beadColumn = "none", dilutionColumn = "none")