methods-amModel: Methods For Displaying, Summarizing, And Manipulating...

Description Usage Arguments Details Examples

Description

Getters and setters for models and data.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
## 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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# 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']]

AMModels documentation built on May 1, 2019, 10:25 p.m.