dynamic: dynamic objects

Description Usage Arguments Examples

Description

creates a dynamic object, comprising multiple transition objects to define a dynamical system. dynamic objects are the core of pop, since they can be created and updated using various methods (MPMs, IPMs etc.), combined (by addition of two dynamic objects to make another) and and analysed in various ways (deterministically to obtain demographic parameters, simulated to evaluate population viability etc.)

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
dynamic(...)

is.dynamic(x)

## S3 method for class 'dynamic'
plot(x, ...)

states(x)

## S3 method for class 'dynamic'
print(x, ...)

## S3 method for class 'dynamic'
as.matrix(x, which = c("A", "P", "F", "R"), ...)

## S3 method for class 'dynamic'
parameters(x)

## S3 replacement method for class 'dynamic'
parameters(x) <- value

Arguments

x

a dynamic object to print, plot, convert to a transition matrix, or an object to test as a dynamic object (for is.dynamic),

which

which type of matrix to build: the overall population growth matrix ('A'), the probabilistic progression matrix ('P'), the fecundity matrix ('F') or the intrinsic reproduction matrix ('R')

value

a nested named list of parameters within each transition matching those currently defined for x

...

for dynamic(): one or more transition (or other dynamic) objects making up the dynamic. For plot() and print(): further arguments passed to or from other methods

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
40
41
42
43
44
45
46
# define transitions for a simple three-stage system (with implicit
# mortality):
stasis_egg <- tr(egg ~ egg, p(0.4))
stasis_larva <- tr(larva ~ larva, p(0.3))
stasis_adult <- tr(adult ~ adult, p(0.8))
hatching <- tr(larva ~ egg, p(0.5))
fecundity <- tr(egg ~ adult, r(3))
pupation <- tr(adult ~ larva, p(0.2))

# combine these into separate dynamics
stasis <- dynamic(stasis_egg,
                  stasis_larva,
                  stasis_adult)
growth <- dynamic(hatching,
                  pupation)
reproduction <- dynamic(fecundity)

# combine these into one dynamic (the same as listing all the transitions
# separately)
all <- dynamic(stasis, growth, reproduction)

# plot these
plot(stasis)
plot(growth)
plot(all)

# get component states
states(all)

# print method
print(all)

# convert to a transition matrix
as.matrix(all)
# extract the parameters
(param_stasis <- parameters(stasis))
(param_all <- parameters(all))

# update the parameters of these transfuns
param_stasis$stasis_egg$p <- 0.6
parameters(stasis) <- param_stasis
parameters(stasis)

param_all$fecundity$r <- 15
parameters(all) <- param_all
parameters(all)

goldingn/pop documentation built on May 17, 2019, 7:42 a.m.