| batchstat {qpcR} | R Documentation |
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.
batchstat(..., group = NULL, do = c("cbind", "stat"), statfun = mean)
... |
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". |
statfun can be any internal R function, i.e. sd, median etc.
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".
Andrej-Nikolai Spiess
## 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))