Learn R Programming

pla (version 0.2)

assayTable2frame: Expand table to matrix of measurements by variables - for pla.fit and pla.plots

Description

A table, that is, a 2-dimensional array, with the responses of an experiment is transformed for into a matrix, a data.frame, with rows for the individual measurements and columns the variables and factors of the assay - for pla.fit and pla.plots.

Usage

assayTable2frame(table, dr = 2, Z = log((1/dr)^(max(Dilution) - Dilution)), byOrder = TRUE, echoData = TRUE, ...)

Arguments

table
A table in an object of class array. This is here usually in this tool the result of as.array on the result of readAssayTable.
dr
The dilution ratio of the geometric dilution serie with equally spaced dilutions (constant ratio between any adjacent dilutions) on the logarithmic scale. See also data2assayFrame.
Z
The 'concentration', by default computed as $log((1/dr)^{(max(Dilution) - Dilution)})$, where Dilution is dilution step. See also data2assayFrame.
byOrder
If TRUE then the order of the columns defines the order and values of the dilution steps - for tables read by readAssayTable with the single repetition over several lines. If FALSE then the 'dose' is extracted from the dimnames of the table and as well Dilution and Z is given this value.
echoData
If TRUE then the data is shown with means, standard deviations and coefficients of variations of columns.
...
For additional arguments.

Value

A data.frame with rows of individual observations and columns of treatments, dilution step numbers, replicate numbers (blocks), response-values, etc.

Details

This function is used on table of data read by readAssayTable. The table of responses is transformed into a data.frame with the relevant columns Response, Dilution, Sample, and Replicate. The rows of the input table are replicates, and the columns of the input table are the cross classification samples and dilutions.

Examples

Run this code
data(HepatitisB); Data <- HepatitisB

Data <- readAssayTable(paste(system.file(package = "pla"),
                             "vignettes/PhEur/data/HepatitisB.txt",
                             sep = "/"), fun = log)
Frame  <- assayTable2frame(as.array(Data))

Run the code above in your browser using DataLab