oneRowOneDetection: Expand a record table to have one row for each detection

View source: R/OneRowOneDetection.R

oneRowOneDetectionR Documentation

Expand a record table to have one row for each detection

Description

If a record table has a count column, this function expand the record table to have a row for each detection based on the count column.

Usage

oneRowOneDetection(intable, countsName)

Details

NOTE: This function is currently possibly slow (a few mins) for recortable that are more than 1E4, so be patient!

Value

record table (data.table)

Examples

# create a test recordTable
# Make up a test recTable
recTest <- data.table(fileName=LETTERS[1:5],
Group1Count=c(rep(2,4), 1), # The count of individuals in the first group (G1)
Group1Species= c(rep("sambar", 4), "Fallow"), # The species of G1
Group1Sex=sample(c("Male", "Female", NA), 5, replace = T) # The sex of G1
)
recTest

# Replicate rows
OROD <- oneRowOneDetection(W2L, countsName = "Group1Count")
OROD


carlopacioni/camtrapRdeluxe documentation built on Nov. 29, 2023, 3:37 a.m.