Learn R Programming

pla (version 0.2)

data2assayFrame: Check dataframe for pla.fit

Description

Check and prepare a dataframe with data for pla, pla.fit, and pla.plots.

Usage

data2assayFrame(dataframe, dr = 1.5, Z = log((1/dr)^(max(Dilution) - Dilution)), design = "lsd")

Arguments

dataframe
dataframe with the columns Response, Dilution, Sample, and Replicate (or Row and Column).
dr
The dilution ratio of the geometric dilution serie with equally spaced dilutions (constant ratio between any adjacent dilutions) on the logarithmic scale.
Z
The 'concentration', by default computed as $log((1/dr)^{(max(Dilution) - Dilution)})$, where Dilution is a columns of the argument dataframe.
design
If "lsd", then Row and Column has to be columns of the dataframe, and a column Replicate is copied from Row. Replicate and Row is also used for 'block' and 'plate'. Column is for "lsd" ("Latin Square Design") used for the 'other' factor. For the designs "crd" and "rbd" Replicate has to be a column of the argument dataframe.

Value

A data.frame.

Details

This function is used internally in pla to check the dataframe that can be given with the data for pla.fit. It can also be used to prepare a dataframe for direct call of pla.fit. Relevant columns are added for pla.fit, and the dataframe is sorted for pla.plots.

Examples

Run this code

# Example 1:

require(graphics)
Dilution  <- 2 + log(ToothGrowth["dose"]) / log(2)
names(Dilution) <- "Dilution"
Replicate <- rep(1:10, 6)
Data      <- cbind(ToothGrowth, Replicate, Dilution)
dimnames(Data)[[2]] <- c("Response", "Sample", "Dose", "Replicate", "Dilution")
Design    <- "crd"
Frame     <- data2assayFrame(Data, dr = 2, design = Design)
Fits      <- pla.fit(Frame, sampleLabels = c("VC", "OJ"), dr = 2,
                     design = Design, main = "ToothGrowth", show = TRUE)
pla.plots(Frame, design = Design,
          sampleLabels = c("VC", "OJ"), main = "ToothGrowth")

# Example 2:

data(AgarDiffusionAssay)

# Agar   <- read.table("./pla/vignettes/PhEur/data/AntibioticAgarDiffusionAssay.txt",
#                      header = TRUE)
Agar     <- AgarDiffusionAssay
Design   <- "lsd"
select   <- c("Row", "Column", "Sample", "Dilution", "Response")
Frame    <- data2assayFrame(Agar[, select])

fits   <- pla.fit(Frame, design = Design, sampleLabels = c("S", "T"),
                  dr = 1.5, returnPotencyEstimates = TRUE)

## Alternative on object of class 'pla':

plaModel <- plaLSD(Agar)
Fits <- fit(plaModel)

Run the code above in your browser using DataLab