read.trapping: Read trapping data

Description Usage Arguments Details Value

Description

read.trapping reads data from an excel file and returns a data.frame after having conducted basic quality checks

Usage

1
2
3
read.trapping(dir.in = NULL,
  nfile = "Woodland Reserve Fauna Data.xlsx", sheet = "DB",
  last.row = 0)

Arguments

dir.in

The path to the folder where the data file is located

nfile

The name of the (excel) data file

sheet

The name of the sheet to be imported

last.row

An integer with the number of the last row to be imported. If zero (default), the last row is determined automatically

Details

Default file name is "Woodland Reserve Fauna Data.xlsx", but this can be set to NULL and an interactive window will open to browse to the file. In this case, dir.in is taken from the path of the file selected.

If dir.in is NULL and nfile is provided, then an interactive window is opened to select the path to nfile.

If last.row is left to default (0), a warning is reported. This is because currently the excel file uses several formula to validate/obtain data from the IDs list. If validated fields/formula are present in the last lines (even if no data is actually inserted) these are read as non-empty rows in R and filled with NA, potentially causing problem for downstream analyses.

read.trapping will check whether numeric data are stored in numeric vectors and whether morphometric measurements contain values that are zeros (which are clearly not correct for morphometric measurements). A warning is reported in the first case and zero values are replaced with NA in order exclude them from further analyses.

The number of codes found for the categorigal variables and a print out of the codes is also reported.

Value

A data.frame


carlopacioni/WPdata documentation built on June 4, 2019, 2:08 p.m.