bSims (version 0.2-1)

get_nests: Access nests, events, detections, and totals

Description

Access nests, events, detections, abundance, and density from simulation objects.

Usage

get_nests(x, ...)
# S3 method for bsims_population
get_nests(x, ...)

get_events(x, ...) # S3 method for bsims_events get_events(x, ...)

get_detections(x, ...) # S3 method for bsims_detections get_detections(x, ...)

get_abundance(x, ...) # S3 method for bsims_population get_abundance(x, ...)

get_density(x, ...) # S3 method for bsims_population get_density(x, ...)

get_table(x, ...) # S3 method for bsims_transcript get_table(x, type = c("removal", "visits"), ...)

Arguments

x

simulation object.

type

character, the type of table to return: "removal" includes only new individuals as time progresses, "visits" counts individuals in each time interval independent of each other.

other arguments passed to internal functions.

Value

get_abundance and get_density returns a non-negative numeric value.

get_nests returns a data frame with the following columns: i individual identifier, s spatial stratum (H: habitat, E: edge, R: road) x and y are coordinates of the nest locations, g is behavioral (mixture) group or NA.

get_events returns a data frame with the following columns: x and y are locations of the individual at the time of the event, t time of the event within the duration interval, v indicator variable for vocal (1) vs. movement (0) event, i individual identifier.

get_detections returns a data frame with the following columns: x and y are locations of the individual at the time of the event, t time of the event within the duration interval, v indicator variable for vocal (1) vs. movement (0) event, d distance from observer when detected (otherwise NA). i individual identifier, j perceived individual identifier.

get_table returns a matrix with distance bands as rows and time intervals as columns. The cell values are counts if the individuals detected in a removal fashion (only new individuals counter over the time periods) or in a multiple-visits fashion (counting of individuals restarts in every time interval).

Details

get_nests extracts the next locations.

get_events extracts the events.

get_detections extracts the detections.

get_abundance gets the realized total abundance (N), get_density gets the realized average density (abundance/area: N/A).

get_table returns the removal or visits table.

See Also

bsims_init

Examples

Run this code
# NOT RUN {
phi <- 0.5                 # singing rate
tau <- 1:3                 # EDR by strata
dur <- 10                  # simulation duration
tbr <- c(3, 5, 10)         # time intervals
rbr <- c(0.5, 1, 1.5, Inf) # counting radii

l <- bsims_init(10, 0.5, 1)# landscape
p <- bsims_populate(l, 1)  # population
e <- bsims_animate(p,      # events
  vocal_rate=phi, duration=dur)
d <- bsims_detect(e,       # detections
  tau=tau)
x <- bsims_transcribe(d,   # transcription
  tint=tbr, rint=rbr)

## next locations
head(get_nests(p))
head(get_nests(e))
head(get_nests(d))
head(get_nests(x))

## abundance
get_abundance(p)
get_abundance(e)
get_abundance(d)
get_abundance(x)

## density
get_density(p)
get_density(e)
get_density(d)
get_density(x)

## events
head(get_events(e))
head(get_events(d))
head(get_events(x))

## detections
head(get_detections(d))
head(get_detections(x))

get_table(x, "removal")
get_table(x, "visits")
# }

Run the code above in your browser using DataCamp Workspace