From 553bf1cc47730a5db42a2ec668da373f79870fdf Mon Sep 17 00:00:00 2001 From: Damiano Oldoni Date: Thu, 9 Nov 2023 10:16:07 +0100 Subject: [PATCH] Add new column to vignette --- vignettes/record-table.Rmd | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/vignettes/record-table.Rmd b/vignettes/record-table.Rmd index 03aec8a1..3f352eb7 100644 --- a/vignettes/record-table.Rmd +++ b/vignettes/record-table.Rmd @@ -44,12 +44,13 @@ If we consider that all observations are independent, then, it will be sufficien get_record_table(mica) ``` -The function returns the same columns as the camtrapR's function `recordTable()`. The following mapping is applied: +The function returns the same columns as the camtrapR's function `recordTable()` except for column `n`. The following mapping is applied: column name output | description --- | --- `Station` | the station name as provided by argument `stationCol` (default: `locationName`). It has to be a column of `deployments` `Species` | `scientific_name` column in `observations` +`n` | `count` column in `observations` (number of individuals) `DateTimeOriginal` | the `timestamp` column in `observations` `Date` | the date from `timestamp` `Time` | the time part from `timestamp` @@ -106,20 +107,19 @@ get_record_table(mica, stationCol = "locationID") It can happen that "duplicates" occur, e.g. when two distinct observations of the same species are made based on the same sequence of images, e.g. same species but different `lifeStage` or `sex`. You can decide what to do with these duplicates by using the argument `removeDuplicateRecords`: by default it is equal to `TRUE`. The duplicates are therefore removed. To not remove them, set `removeDuplicateRecords` equal to `FALSE`. -Let's create an easy example with duplicates based on `mica` datapackage: +Let's create an easy example with a duplicate based on `mica` datapackage: ```{r dummy_data_with_duplicates} mica_dup <- mica - mica_dup$observations$sequenceID <- mica_dup$observations$sequenceID[1] - mica_dup$observations$deploymentID <- mica_dup$observations$deploymentID[1] - mica_dup$observations$timestamp <- mica_dup$observations$timestamp[1] - mica_dup$observations$scientificName <- "Anas strepera" +# create a duplicate at 2020-07-29 05:46:48, location: B_DL_val 5_beek kleine vijver +mica_dup$data$observations[4,"sequenceID"] <- mica_dup$data$observations$sequenceID[3] +mica_dup$data$observations[4, "deploymentID"] <- mica_dup$data$observations$deploymentID[3] +mica_dup$data$observations[4, "timestamp"] <- mica_dup$data$observations$timestamp[3] ``` Record table without duplicates: ```{r no_duplicates} -# equivalent of get_record_table(mica, removeDuplicateRecords = TRUE) get_record_table(mica_dup) ```