createSplits | R Documentation |
Given a phyloseq or TreeSummarizedExperiment object from which the random
splits should be created, this function produces a list of 2
data.frame
objects: Subset1
and Subset2
with as many
rows as the number of splits and as many columns as the half of the number
of samples.
createSplits( object, assay_name = "counts", varName = NULL, paired = NULL, balanced = TRUE, N = 1000 )
object |
a phyloseq or TreeSummarizedExperiment object. |
assay_name |
the name of the assay to extract from the
TreeSummarizedExperiment object (default |
varName |
name of a factor variable of interest. |
paired |
name of the unique subject identifier variable. If specified, paired samples will remain in the same split. (default = NULL). |
balanced |
If |
N |
number of splits to generate. |
A list of 2 data.frame
objects: Subset1
and
Subset2
containing N
rows and half of the total number of
samples columns. Each cell contains a unique sample identifier.
data(ps_plaque_16S) set.seed(123) # Balanced design for repeated measures # Balanced design for independent samples splits_df <- createSplits( object = ps_plaque_16S, varName = "HMP_BODY_SUBSITE", balanced = TRUE, N = 100 ) # Unbalanced design splits_df <- createSplits( object = ps_plaque_16S, varName = "HMP_BODY_SUBSITE", balanced = FALSE, N = 100 )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.