Description Usage Arguments Details Value Author(s) Examples
View source: R/A_VideoVsEvents.r
Calls a set of sub-functions to extract data on the match of video data and SNB data of the corresponding dates and times. This function is meant as an easy wrapper for users to assess the advantages and disadvantages of specific parameter settings for the functions that extract SNB events (INs and OUTs).
1 | SNBvsVid_v2(con, timescale, ...)
|
con |
A connection to the database |
timescale |
The timescale (in seconds) within which the fit with the video data is calculated (only relevant for the last output "Match of SNB and Video data by unit of time"). |
... |
Any parameters that can be set for the function events_v2() |
The function calls the following functions:
videoEvaluation_v2 which loads all SNB and Video data, unifies the times, merges the datasets and prepares the first 6 list items of the output.
videoTimeCheck_v2 which calculates from individual "INs" and "OUTs" at which times a birds was at the nestbox
checkIn_v2 which returns the 7th list item of the output
List of length 7 with the following slots:
Time difference summary |
Summary of the time differences between Video and SNB data. Note that the time of the videos is here only scored to the minute. |
Quality of transponder assignment |
Vector of length 3:
|
Best fit SNB to video |
Dataset where each video event is matched with the SNB event that fits best in time. |
Best fit video to SNB |
Dataset where each SNB event is matched with the video event that fits best in time. |
SNB data |
SNB events as calculated by the |
Video data |
Video events as scored in the videos. The script that fetches and processes the raw video data can be found in the inst folder of this package. |
Match of SNB and Video data by unit of time |
A data.table where each row represents a unit of time as specified by the argument "timescale", and with the following columns:
|
LS
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 | ##not run
#create connection
con = dbcon('YOUR_USER_NAME')
#Set the variables you want to check
check = SNBvsVid_v2(con, timescale = 2, max_distance = 30)
check[[1]]
#--> the max. difference between SNB and video data is less than 1 minute.
check[[2]]/nrow(check[[6]])
#--> proportion of transponders missed based on definition (see section "Value")
#Plot method by unit of time
plot(check[[7]], ParentsOnly = FALSE) #All SNB data
plot(check[[7]], ParentsOnly = TRUE) #Only SNB data with the parental transponder
#Note that for each box and date the upper row of points represents SNB activity without corresponding video activity, the bottom row of points represents Video activity without corresponding SNB activity and the middle row represents data that match. Activity within 1 unit of time to activity scored via the other method is still marked green.
#table of consistency of SNB vs. video data per unit of time
table(check[[7]][, list(videoIn, snbIn)])
#table of consistency of SNB vs. video data, if a mismatch by 1 unit of time is "ok"
table(check[[7]][,COL]) #"green" = ok, "blue" = event in video, but not SNB data, "red" = event in SNB not video data
#table which (detailed) SNB directions are merged with which directions in the video data
table(check[[4]][,list(snb_action_detail, vid_action)])
#table how detailed SNB directions are translated into non-detailed directions
table(check[[4]][,list(snb_action_detail, snb_action)])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.