tte_estN_fn: Estimate abundance with time-to-event (TTE)

Description Usage Arguments Value Examples

View source: R/tte_estN_fn.R

Description

Estimate abundance with time-to-event (TTE)

Usage

1
tte_estN_fn(eh, study_area)

Arguments

eh

TTE encounter history. A data.frame formulated by tte_build_eh

study_area

Size of the study area (same units as camera viewshed)

Value

A data.frame with the estimated abundance with its standard error and confidence intervals

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
df <- data.frame(
  cam = c(1,1,2,2,2),
  datetime = as.POSIXct(c("2016-01-02 12:00:00",
                        "2016-01-03 13:12:00",
                        "2016-01-02 12:00:00",
                        "2016-01-02 14:00:00",
                        "2016-01-03 16:53:42"),
                      tz = "GMT"),
  count = c(1, 0, 2, 1, 2)
)
deploy <- data.frame(
  cam = c(1, 2, 2, 2), 
  start = as.POSIXct(c("2015-12-01 15:00:00",
                       "2015-12-08 00:00:00", 
                       "2016-01-01 00:00:00", 
                       "2016-01-02 00:00:00"),
                     tz = "GMT"),
  end = as.POSIXct(c("2016-01-05 00:00:00", 
                     "2015-12-19 03:30:00", 
                     "2016-01-01 05:00:00",
                     "2016-01-05 00:00:00"), 
                   tz = "GMT"),
  area = c(300, 200, 200, 450)
)
study_dates <- as.POSIXct(c("2016-01-01 00:00:00", "2016-01-04 23:59:59"), tz = "GMT")
per <- tte_samp_per(deploy, lps = 30/3600)
occ <- tte_build_occ(
  per_length = per,
  nper = 24,
  time_btw = 2 * 3600,
  study_start = study_dates[1],
  study_end = study_dates[2]
)
tte_eh <- tte_build_eh(df, deploy, occ,  per) 
tte_estN_fn(tte_eh, 1e6)

annam21/TTE.STE.IS documentation built on Dec. 24, 2021, 8:42 a.m.