ModelData {morseDR}R Documentation

Creates a data set for binary data analysis

Description

The data argument contains the experimental data provided as a data.frame. It as to satisfied requirement of BinaryData, CounData or ContinuousData as detailled below. The function fails if data does not meet the expected requirements. Note that experimental data with time-variable exposure are not supported.

Usage

binaryData(data, ...)

## S3 method for class 'data.frame'
binaryData(data, ...)

continuousData(data, ...)

## S3 method for class 'data.frame'
continuousData(data, ...)

countData(data, ...)

## S3 method for class 'data.frame'
countData(data, ...)

modelData(data, type, ...)

## S3 method for class 'data.frame'
modelData(data, type = NULL, ...)

Arguments

data

a data.frame with specific requirement.

  • For BinaryData: it should be a data.frame containing the following four columns:

    • replicate: a vector of any class numeric, character or factor for replicate identification. A given replicate value should identify the same group of individuals followed in time

    • conc: a vector of class numeric with tested concentrations (positive values, may contain NAs)

    • time: a vector of class integer with time points, minimal value must be 0

    • Nsurv: a vector of class integer providing the number of alive individuals at each time point for each concentration and each replicate (may contain NAs)

  • For CountData: it's a data.frame as expected by BinaryData containing one additional Nrepro column of class integer with positive values only. This column should provide the number of offspring produced since the last observation.

  • For continuousData: a data.frame containing the following four columns:

    • conc: a vector of class numeric with tested concentrations (positive values, may contain NAs)

    • time: a vector of class integer with time points, minimal value must be 0

    • measure: a vector of class numeric providing the measurement (any quantitative continuous variable describing a measure on the organisms such as length/weight of organism or shoot length and dry weight for plants.)

    • replicate (non mandatory): a vector of any class numeric, character or factor for replicate identification. A given replicate value should identify the same group of individuals followed in time

...

Further arguments to be passed to generic methods

type

must be declared as 'binary', 'count' or 'continuous'.

Value

An object of class BinaryData, CountData or ContinuousData.

See Also

binaryDataCheck

countDataCheck

continuousDataCheck

Examples


# (1) Load the survival data set
data(zinc)
# (2) Create an objet of class 'BinaryData'
dat <- binaryData(zinc)
class(dat)


# (1) Load the data set
data(chlordan_daphnia)
# (2) Create an objet of class 'continuousData'
dat <- continuousData(chlordan_daphnia)
class(dat)


# (1) Load reproduction dataset
data(cadmium1)
# (2) Create an object of class "CountData"
dat <- countData(cadmium1)
class(dat)


# Create an objet of class 'CountData'
d <- modelData(zinc, type = "count")
class(d)


[Package morseDR version 0.1.2 Index]