Learn R Programming

cg (version 1.0-3)

prepare: Prepare a cg data object from a data frame

Description

Reads in a data frame and settings in order to create a cg Data object.

Usage

prepare(type, ...)

Arguments

type
Values and synonyms to create a cg data object. For one factor / unpaired samples, either "onefactor" or "unpairedgroups" can be specified. For paired samples, either "paireddifference" or "pairedgroups" can be used. Partial matching also allows shortened forms such as "unpaired" or "paireddiff".
...
Depends on the specific function that is called according to the type argument. For current valid calls, no ... arguments are used.

Value

See cgOneFactorData and cgPairedDifferenceData for possible valid objects that are created, dependent on the type and ... arguments that are correctly specified.

See Also

prepareCGOneFactorData, prepareCGPairedDifferenceData

Examples

Run this code
data(canine)
canine.data <- prepare(type="unpairedgroups", dfr=canine,
                       format="groupcolumns",
                       analysisname="Canine",
                       endptname="Prostate Volume",
                       endptunits=expression(plain(cm)^3),
                       digits=1, logscale=TRUE, refgrp="CC")

## Censored Data
data(gmcsfcens)
gmcsfcens.data <- prepare(type="onefactor",
                          dfr=gmcsfcens, format="groupcolumns",
                          analysisname="cytokine",
                          endptname="GM-CSF (pg/ml)",
                          logscale=TRUE)

## Paired Groups
data(anorexiaFT)
anorexiaFT.data <- prepare(type="paireddiff",  ## Partial matching
                           dfr=anorexiaFT, format="groupcolumns",
                           analysisname="Anorexia FT",
                           endptname="Weight",
                           endptunits="lbs",
                           expunitname="Patient",
                           digits=1, logscale=TRUE)

Run the code above in your browser using DataLab