eva: Pipeline function to extract events

View source: R/A_EVENTS_v1_v2_pipeline.r

evaR Documentation

Pipeline function to extract events

Description

Fetches the raw data using a connection to the database based on dbcon, then calculates when an individual was assumably at the nest box. Runs across the databases SNBatWESTERHOLZ and SNBatWESTERHOLZ_v2. Uses parallel computing.

Usage

eva(
  df,
  setTZ = "Etc/GMT-2",
  time_threshold_v1 = 2,
  max_distance_v1 = 16 * 60 * 60,
  tr_threshold_v2 = 5,
  cluster_events_threshold_v2 = 2,
  max_distance_v2 = 16 * 60 * 60,
  cluster_fronts_threshold_v2 = 5,
  no_front_v2 = NULL,
  N_cores = 50
)

Arguments

df

a data.table that contains three columns about which data should be fetched: the box numbers, and the corresponding from and to (column names: box, from, to). See examples.

time_threshold_v1

time_threshold argument for function events_v1

max_distance_v1

max_distance argument for function events_v1

tr_threshold_v2

tr_threshold argument for function events_v2

cluster_events_threshold_v2

cluster_events_threshold argument for function events_v2

max_distance_v2

max_distance argument for function events_v2

cluster_fronts_threshold_v2

arguments for function events_v2

no_front_v2

no_front argument for function events_v2

con

the connection to the database.

Note

Note that currently you need to have saved your credentials via save_credentials in order to run the function.

Author(s)

LS

Examples

df = data.table(box = 1, from = "2019-05-01 00:00:00", to = "2019-06-30 00:00:00")
hooray = eva(df, 
      time_threshold_v1 = 10, tr_threshold_v2 = 100, N_cores = 2)
hooray
plot(hooray)
plot(subset(hooray, !is.na(transp) & box == 1 & in_ > "2019-05-15" & in_ < "2019-05-25"))
#Note that you can access the colours and counts of individual transponders by using
tr = plot(hooray)
tr


mpio-be/SNB2 documentation built on Sept. 17, 2024, 4:27 p.m.