Skip to content

Commit

Permalink
Add new column to vignette
Browse files Browse the repository at this point in the history
  • Loading branch information
damianooldoni committed Nov 9, 2023
1 parent 7be7555 commit 553bf1c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions vignettes/record-table.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -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)
```

Expand Down

0 comments on commit 553bf1c

Please sign in to comment.