knitr::opts_chunk$set(
  collapse = TRUE,
  eval = FALSE,
  echo = TRUE,
  comment = "#>"
)

This is a subtopic of the Database workflow. It covers all handling of the detection data, from the files downloaded in the field to appending the database.

General detections workflow

  1. Download acoustic receivers in the field
  2. Copy all vrls from a given field download range into a new subfolder of YB_Vemco/ using the ybt::copy_vrls() function.
  3. Create a new .vdb in that subfolder, following the naming conventions below.
  4. Process data in VUE, including drift-correction and exporting to .csv
  5. Format the detection .csv(s) in R with the ybt::format_VUE_detections() function
  6. Append the resulting detections dataframe to SQLite database using the ybt::ybt_db_append() function
  7. Back up updated database to cloud and/or external storage

1. Download Receivers in the field

YB_Vemco
 |-- YBFieldDownloads
 |    |-- Field2020_0901
 |        `--Field2020_0901.vdb
 |        `--VR2W_104440_20200901_1.vrl
 |        `--VR2W-RLD_104440_20200901_1.vrl
 |        `--VR2W_123456_20200901_1.vrl
 |        `--VR2W-RLD_123456_20200901_1.vrl

2. Copy all vrls from a given field download range into a new subfolder of YB_Vemco/ using the ybt::copy_vrls() function.

Name the new subfolder with the range of download dates covered and a "_vrls" suffix. This will result in a directory structure like the following:

YB_Vemco
 |-- YBDetections_2020_0901-2021_0523_vrls
    `--VR2W_104440_20200901_1.vrl
    `--VR2W_123456_20200901_1.vrl
    `--VR2W_104440_20210523_1.vrl
    `--VR2W_123456_20210523_1.vrl
 |-- YBFieldDownloads
 |    |-- Field2020_0901
 |        `--Field2020_0901.vdb
 |        `--VR2W_104440_20200901_1.vrl
 |        `--VR2W-RLD_104440_20200901_1.vrl
 |        `--VR2W_123456_20200901_1.vrl
 |        `--VR2W-RLD_123456_20200901_1.vrl
 |    |-- Field2021_0523
 |        `--Field2020_0901.vdb
 |        `--VR2W_104440_20210523_1.vrl
 |        `--VR2W-RLD_104440_20210523_1.vrl
 |        `--VR2W_123456_20210523_1.vrl
 |        `--VR2W-RLD_123456_20210523_1.vrl

3. Create a new _dc.vdb in that subfolder, following the naming conventions below.

YB_Vemco
 |-- YBDetections_2020_0901-2021_0523_vrls
        |-- YBDetections_2020_0901-2021_0523_dc
            `-- YBDetections_2020_0901-2021_0523_dc.vdb
 |-- YBFieldDownloads

4. Drift-correct and export all detections for detection year

5. Format the detection .csv(s) in R with the ybt::format_VUE_detections() function

The formatting function does the following:

6. Append the resulting detections dataframe to SQLite database

This is done using the ybt::ybt_db_append() function; see vignettes('Database', package = 'ybt')



fishsciences/ybt documentation built on March 11, 2021, 8:45 a.m.