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

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.

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.

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).

See also

bsims_init

Examples

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))
#> i s x y g #> 1 1 H -2.842355 -1.364885 NA #> 2 2 H -1.559715 -4.149819 NA #> 3 3 H -2.392815 -2.679242 NA #> 4 4 H -1.790609 3.126341 NA #> 5 5 H -1.777009 -3.129813 NA #> 6 6 H -4.414764 -3.687225 NA
head(get_nests(e))
#> i s x y g #> 1 1 H -2.842355 -1.364885 G1 #> 2 2 H -1.559715 -4.149819 G1 #> 3 3 H -2.392815 -2.679242 G1 #> 4 4 H -1.790609 3.126341 G1 #> 5 5 H -1.777009 -3.129813 G1 #> 6 6 H -4.414764 -3.687225 G1
head(get_nests(d))
#> i s x y g #> 1 1 H -2.842355 -1.364885 G1 #> 2 2 H -1.559715 -4.149819 G1 #> 3 3 H -2.392815 -2.679242 G1 #> 4 4 H -1.790609 3.126341 G1 #> 5 5 H -1.777009 -3.129813 G1 #> 6 6 H -4.414764 -3.687225 G1
head(get_nests(x))
#> i s x y g #> 1 1 H -2.842355 -1.364885 G1 #> 2 2 H -1.559715 -4.149819 G1 #> 3 3 H -2.392815 -2.679242 G1 #> 4 4 H -1.790609 3.126341 G1 #> 5 5 H -1.777009 -3.129813 G1 #> 6 6 H -4.414764 -3.687225 G1
## abundance get_abundance(p)
#> [1] 90
get_abundance(e)
#> [1] 90
get_abundance(d)
#> [1] 90
get_abundance(x)
#> [1] 90
## density get_density(p)
#> [1] 0.9
get_density(e)
#> [1] 0.9
get_density(d)
#> [1] 0.9
get_density(x)
#> [1] 0.9
## events head(get_events(e))
#> x y t v i #> 1 -4.746214 3.9939078 0.003013719 1 25 #> 2 -4.285633 -1.3128309 0.017130100 1 24 #> 3 -1.841209 2.6106323 0.028861828 1 11 #> 4 -1.547293 3.3425373 0.082154865 1 13 #> 5 1.459763 -0.8257142 0.122009585 1 57 #> 6 -0.876805 -3.5741085 0.122322296 1 35
head(get_events(d))
#> x y t v i #> 1 -4.746214 3.9939078 0.003013719 1 25 #> 2 -4.285633 -1.3128309 0.017130100 1 24 #> 3 -1.841209 2.6106323 0.028861828 1 11 #> 4 -1.547293 3.3425373 0.082154865 1 13 #> 5 1.459763 -0.8257142 0.122009585 1 57 #> 6 -0.876805 -3.5741085 0.122322296 1 35
head(get_events(x))
#> x y t v i #> 1 -4.746214 3.9939078 0.003013719 1 25 #> 2 -4.285633 -1.3128309 0.017130100 1 24 #> 3 -1.841209 2.6106323 0.028861828 1 11 #> 4 -1.547293 3.3425373 0.082154865 1 13 #> 5 1.459763 -0.8257142 0.122009585 1 57 #> 6 -0.876805 -3.5741085 0.122322296 1 35
## detections head(get_detections(d))
#> x y t v d i j #> 7 -0.3962579 0.1802149 0.1248093 1 0.4353134 50 50 #> 9 0.7534995 -1.4849584 0.1400594 1 1.6651916 54 54 #> 10 -0.3962579 0.1802149 0.1592397 1 0.4353134 50 50 #> 12 -0.4491670 -0.4087656 0.2105982 1 0.6073222 48 48 #> 26 0.2843549 1.4881139 0.5519138 1 1.5150382 49 49 #> 27 -1.7906090 3.1263407 0.5548629 1 3.6028165 4 4
head(get_detections(x))
#> x y t v d i j #> 7 -0.3962579 0.1802149 0.1248093 1 0.4353134 50 50 #> 9 0.7534995 -1.4849584 0.1400594 1 1.6651916 54 54 #> 12 -0.4491670 -0.4087656 0.2105982 1 0.6073222 48 48 #> 26 0.2843549 1.4881139 0.5519138 1 1.5150382 49 49 #> 27 -1.7906090 3.1263407 0.5548629 1 3.6028165 4 4 #> 31 0.4822622 0.2688180 0.6752232 1 0.5521232 44 44
get_table(x, "removal")
#> 0-3min 3-5min 5-10min #> 0-50m 1 0 0 #> 50-100m 2 0 0 #> 100-150m 1 0 0 #> 150+m 5 0 1
get_table(x, "visits")
#> 0-3min 3-5min 5-10min #> 0-50m 1 1 1 #> 50-100m 2 1 2 #> 100-150m 1 1 1 #> 150+m 5 7 9