batchstat {qpcR}R Documentation

Concatenating or calculating statistics on a 'pcrbatch'

Description

This function will either concatenate data from several pcrbatches or calculate some user-defined statistic on the runs within a pcrbatch. If the latter is chosen, a grouping vector must be supplied for defining the runs to be subjected to statistical analysis.

Usage

batchstat(..., group = NULL,  do = c("cbind", "stat"), statfun = mean) 

Arguments

... one or more pcrbatches. See 'Examples'.
group in case of do = "stat", a vector defining the groups for statistical analysis.
do concatenate or analyse?
statfun the statistical function to be used if do = "stat".

Details

statfun can be any internal R function, i.e. sd, median etc.

Value

Either a concatenated dataframe (do = "cbind"), or a list containing a dataframe(s) with the statistical output for each factor level defined in group, if do = "stat".

Author(s)

Andrej-Nikolai Spiess

Examples

## create 3 'pcrbatch'es
## and concatenate
dat1 <- pcrbatch(reps, 2:5, l4)
dat2 <- pcrbatch(reps, 6:9, l4)
dat3 <- pcrbatch(reps, 10:13, l4)
batchstat(dat1, dat2, dat3)

## one 'pcrbatch' and doing 
## mean on replicates
## defined by 'group'
dat4 <- pcrbatch(reps, 2:9, l4)
GROUP <- c(1, 1, 1, 1, 2, 2, 2, 2)
batchstat(dat4, do = "stat", group = GROUP, statfun = mean)

## get the standard deviation 
batchstat(dat4, do = "stat", group = GROUP, statfun = sd)

## do stats on many 'pcrbatch'es
## All batches must have same length!
batchstat(dat1, dat2, dat3, do = "stat", 
          group = c(1, 1, 2, 2)) 

[Package qpcR version 1.2-4 Index]