createTimePoints {statgenHTP}R Documentation

Create an object of class TP

Description

Convert a data.frame to an object of class TP (Time Points). The function converts a data.frame to an object of class TP in the following steps:

Note that plotId needs to be a unique identifier for a plot or a plant. It cannot occur more than once per time point.

Usage

createTimePoints(
  dat,
  experimentName,
  genotype,
  timePoint,
  timeFormat = NULL,
  plotId,
  repId = NULL,
  rowNum = NULL,
  colNum = NULL,
  addCheck = FALSE,
  checkGenotypes = NULL
)

Arguments

dat

A data.frame.

experimentName

A character string, the name of the experiment. Stored with the data and used in default plot titles.

genotype

A character string indicating the column in dat containing the genotypes.

timePoint

A character string indicating the column in dat containing the time points.

timeFormat

A character string indicating the input format of the time points. E.g. for a date/time input of the form day/month/year hour:minute, use "%d/%m/%Y %H:%M". For a full list of abbreviations see strptime. If NULL, a best guess is done based on the input.

plotId

A character string indicating the column in dat containing the plotId. This has to be a unique identifier per plot/plant per time point.

repId

A character string indicating the column in dat containing the replicates.

rowNum

A character string indicating the column in dat containing the row number of the plot.

colNum

A character string indicating the column in dat containing the column number of the plot.

addCheck

Should a column check be added to the output? If TRUE, checkGenotypes cannot be NULL.

checkGenotypes

A character vector containing the genotypes used as checks in the experiment.

Value

An object of class TP. A list with, per time point in the input, a data.frame containing the data for that time point. A data.frame with columns timeNumber and timePoint is added as attribute timePoints to the data. This data.frame can be used for referencing timePoints by their number.

See Also

Other functions for data preparation: as.data.frame.TP(), getTimePoints(), plot.TP(), removeTimePoints(), summary.TP()

Examples

## Create a TP object containing the data from the Phenovator.
phenoTP <- createTimePoints(dat = PhenovatorDat1,
                            experimentName = "Phenovator",
                            genotype = "Genotype",
                            timePoint = "timepoints",
                            repId = "Replicate",
                            plotId = "pos",
                            rowNum = "y", colNum = "x",
                            addCheck = TRUE,
                            checkGenotypes = c("check1", "check2",
                                               "check3","check4"))
summary(phenoTP)


[Package statgenHTP version 1.0.6.1 Index]