methods-amModel {AMModels}R Documentation

Methods For Displaying, Summarizing, And Manipulating amModel And amData Objects

Description

Getters and setters for models and data.

Usage

## S4 method for signature 'amModel'
summary(object, ...)

## S4 method for signature 'amModel,ANY,ANY,ANY'
x[i, j, ..., drop = TRUE]

## S4 method for signature 'amModel,ANY,ANY'
x[[i]]

## S4 replacement method for signature 'amModel,ANY,ANY'
x[i, j, ...] <- value

## S4 replacement method for signature 'amModel,ANY,ANY'
x[[i]] <- value

## S4 method for signature 'amData'
summary(object, ...)

## S4 method for signature 'amData,ANY,ANY,ANY'
x[i, j, ..., drop = TRUE]

## S4 method for signature 'amData,ANY,ANY'
x[[i]]

## S4 replacement method for signature 'amData,ANY,ANY'
x[i, j, ...] <- value

## S4 replacement method for signature 'amData,ANY,ANY'
x[[i]] <- value

Arguments

object, x

An amModel or amData object.

...

Additional arguments passed to other functions or methods.

i, j

indices specifying elements to extract or replace. Indices are numeric or character vectors or empty (missing) or NULL.

drop

Not used.

value

Replacement value.

Details

Summary assumes some meaningful summary method exists for each object in its home package.

Examples


# create dataset from lm helpfile
## Annette Dobson (1990) "An Introduction to Generalized Linear Models".
## Page 9: Plant Weight Data.
ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14)
trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69)
group <- gl(2, 10, 20, labels = c("Ctl","Trt"))
weight <- c(ctl, trt)
lm.D9 <- lm(weight ~ group)
lm.D90 <- lm(weight ~ group - 1) # omitting intercept


# create am amModel object
full.model <- amModel(
    model = lm.D9, 
    comment = 'full model', 
    source = 'lm helpfile (R).', 
    taxa = 'plants', 
    data = 'plant.data'
)


# create an amData object
plant.data <- data.frame(group = group, weight = weight)
plant.data <- amData(
    data = plant.data, 
    source = 'lm helpfile (R).',
    comment = 'Dataset from lm helpfile.'
)

summary(full.model)

# [ and [[ index from metadata
full.model[c(2,1)]
full.model[[1]]
full.model[['taxa']]

plant.data[c(2,1)]
plant.data[[1]]
plant.data[['comment']]


[Package AMModels version 0.1.4 Index]