read.FMDB: Read CSV of WiDNR Fish Management Data.

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Reads a CSV of WiDNR Fish Management Data, sets variable classes, and optionally adds some variables and expands fish counts.

Usage

1
2
3
read.FMDB(file, addSpecies = TRUE, addMonth = TRUE, expandCounts = FALSE,
  whichLengths = c("in", "mm"), lprec = 0.1, na.strings = c("-", "NA",
  ""), verbose = TRUE)

Arguments

file

The name of the external CSV file from the WiDNR Fisheries Management Database.

addSpecies

A logical that indicates whether a new variable of species names where only the first word is capitalized should be added to the returned data.frame.

addMonth

A logical that indicates whether a new variable of month of capture should be added to the returned data.frame.

expandCounts

A logical that indicates whether counts of fish of the same length should be expanded to be individual fish in the returned data.frame or not. See expandCounts in FSA.

whichLengths

A character string that indicates whether the expanded lengths, when expandCounts=TRUE, use the English (inches; whichLengths="in") or metric (mm; whichLengths="mm") units variable.

lprec

A single numeric that controls the precision to which the random lengths are recorded. See details in expandCounts in FSA.

na.strings

A vector of character strings that indicate what type of characters should be considered missing when reading the CSV file. Likely does not need to be changed.

verbose

A logical that indicates whether progress messages should be printed or not.

...

Not yet implemented.

Details

This function is used to read a CSV created directly from the WiDNR Fish Management Database and appropriately set the class type (e.g., integer, factor, etc.) for the variables. Optionally, the user may add the month the fish was collected and change the species names so that only the first letters are capitalized (so as to work more easily with other functions). Furthermore, the user may optionally choose to expand the counts of fish of the same lengths (often times no length was recorded, fish were just counted).

Value

A data.frame.

Author(s)

Derek H. Ogle, dogle@northland.edu

See Also

setFMDBClasses; expandCounts in FSA.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Get external file (as part of the package)
ftmp <- system.file("extdata", "FMDB_ex.csv",package="fishWiDNR")

## Read file without expanding counts
df1 <- read.FMDB(ftmp)
str(df1)

## Read file with expanding counts
df2 <- read.FMDB(ftmp,expandCounts=TRUE)
str(df2)

droglenc/fishWiDNR documentation built on May 15, 2019, 2:51 p.m.