state: Create a state object

Description Usage Arguments Details Value Examples

View source: R/state-class.R

Description

A state object is a static representation of habitat, population, and demography in a single timestep.

Usage

1
2
3
4
5
6
state(population, habitat, demography)

is.state(x)

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

Arguments

population

A population object.

habitat

A habitat object.

demography

A demography object.

x

A state object to print or test.

...

Further arguments passed to or from other methods.

Details

A state object is modified in each timestep of a simulation based on specified functions in a dynamics object. When first created, the state object will hold initial values for habitat, population, and demography which may or may not change throughout a simulation.

Value

An object of class state

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
library(steps)
library(raster)

# Create habitat, demography, and population objects
hab <- habitat(egk_hab, egk_k)
dem <- demography(egk_mat)
pop <- population(egk_pop)

# Construct the state object
state <- state(pop, hab, dem)

# Test if object is of the type 'state'
is.state(test_state)

# Print information about the 'state' object
print(test_state)

skiptoniam/dlmpr documentation built on Sept. 26, 2018, 3:11 p.m.