tte_build_occ: tte_build_occ

Description Usage Arguments Value Examples

View source: R/tte_build_occ.R

Description

tte_build_occ

Usage

1
tte_build_occ(per_length, nper, time_btw, study_start, study_end)

Arguments

per_length

numeric. Length of the TTE sampling period.

nper

numeric. Number of TTE sampling periods per sampling occasion.

time_btw

numeric. Length of time between sampling occasions, allowing animals to re-randomize.

study_start

POSIXct. The start of the study.

study_end

POSIXct. The end of the study.

Value

a dataframe

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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)
)
per <- tte_samp_per(deploy, lps = 30/3600)
study_dates <- as.POSIXct(c("2016-01-01 00:00:00", "2016-01-04 23:59:59"), tz = "GMT")
occ2 <- tte_build_occ(
  per_length = per,
  nper = 24,
  time_btw = 2 * 3600,
  study_start = study_dates[1],
  study_end = study_dates[2]
)

annam21/spaceNtime documentation built on Dec. 12, 2021, 2:48 a.m.