CountSamplesPerGroup: Find minimum sample Size per group.

Description Usage Arguments Value Examples

View source: R/util_CountSamplesPerGroup.R

Description

Find minimum sample size for each group which is decided by the combination of variables with class character or factor.

Usage

1
CountSamplesPerGroup(pheno_df, responses_char, covariates_char)

Arguments

pheno_df

A data frame with phenotype and covariates, which should include all the samples in rnaEdit_df. Please make sure the input pheno_df has the variable named "sample" to indicate sample IDs.

responses_char

A character vector of names of response variables in pheno_df. When respType is set as "survival", responses_char should have length 2. The first element must be the name of the variable with follow up time, and the second element must be the status indicator. Status indicator should be coded as 0/1(1=death), TRUE/FALSE(TRUE=death), or 1/2(2=death). Please make sure variable names are in this order. This code has not been tested for interval-censored data yet.

covariates_char

A character vector of names of covariate variables in pheno_df.

Value

An integer.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
  exm_pheno <- readRDS(
    system.file(
    "extdata",
    "pheno_df.RDS",
    package = 'rnaEditr',
    mustWork = TRUE
    )
  )
  
  CountSamplesPerGroup(
    pheno_df = exm_pheno,
    responses_char = "sample_type",
    covariates_char = "race"
  )

rnaEditr documentation built on Nov. 8, 2020, 8:26 p.m.