Learn R Programming

fishmethods (version 1.3-0)

extractMRFSS: Extraction of Marine Recreational Fisheries Statistics Survey Data from SAS Transport Files

Description

MRFSS intercept and catch/effort data in SAS transport files (.xpt) are extracted using package foreign and are saved as .csv files under data and year-specific subdirectories.

Usage

extractMRFSS(indir = NULL, outdir = NULL, type = NULL,
 state = NULL, styr = NULL, endyr = NULL)

Arguments

indir
the path and directory (in quotes) under which the SAS transport files are stored.
outdir
the path and main directory (in quotes) under which data- and year-specific subdirectories will be created and .csv files will be stored.
type
the type of data to extract. 1 = raw intercept data, 2= catch/effort estimates.
state
the state code(s) designating which state(s) data to extract. If multiple states, separate state codes with commas within the concatentation function. If data from all states are desired, do not include the state= argument. State codes a
styr
the starting year of data to extract.
endyr
the ending year of data to extract.

Value

  • Raw intercept data and catch & effort estimates saved as .csv files.

Details

Download the zipped intercept data and catch/effort estimates from the MRFSS website http://www.st.nmfs.noaa.gov/st1/recreational/index.html. Unzip/extract the SAS transport files (.xpt) to the indir directory. Using this function, specify the indir and outdir directories, which data type to extract, the state code(s), and the starting and ending years (from .xpt files) of data to be extracted. If the outdir directory is not specified, the files will be stored under the indir directory.

References

http://www.st.nmfs.noaa.gov/st1/recreational/index.html.

Examples

Run this code
## This is a typical specification, not a working example
extractMRFSS(indir="C:/Temp",outdir="C:/MRFSS",type=1,state=25,
styr=1981,endyr=2007)

Run the code above in your browser using DataLab