makeDrm2: Reshape a seed germination datasets for time-to-event model...

View source: R/makeDrm.R

makeDrm2R Documentation

Reshape a seed germination datasets for time-to-event model fitting.

Description

This function reshapes a datasets organised as necessary for nonlinear regression into the kind of dataset required by the drmte() function in the 'drcte' package. It works with either the counts of germinated seeds at each monitoring time or the cumulative counts at each monitoring time.

Usage

makeDrm2(counts, treat, nViable, moniTimes, Dish,  cumulative = T)

Arguments

counts

Vector listing the counts of germinated seeds in each Petri dish at each assessment time.

treat

Dataframe listing, for each row of data, the corresponding level of experimental factors (one factor per column)

nViable

A vector listing the number of viable seeds, at the beginning of the assay. This number is the same for all observations belonging to the same dish.

moniTimes

Vector of monitoring times.

Dish

Vector of codes for dishes.

cumulative

Logical: True if counts are cumulative, False if they are not.

Value

Returns a dataframe

Author(s)

Andrea Onofri

Examples

# makeDrm2 (deprecated, example not run)
# data(lotusCum)
# moniTime <- lotusCum$Time
# count <- lotusCum$nCum
# nViable <- rep(25, length(lotusCum[,1]))
# Dish <- as.factor(lotusCum$Dish)
# treatGroups <- lotusCum[,1]
# dataset_sd <- makeDrm2(count, treatGroups, nViable, moniTime, Dish)
# head(dataset_sd)
# count <- lotusCum$nSeeds
# dataset_sd <- makeDrm2(count, treatGroups, nViable, moniTime, Dish,  # cumulative = FALSE)
# head(dataset_sd)

OnofriAndreaPG/drcSeedGerm documentation built on March 14, 2023, 5:45 p.m.