PBSadmb (version 1.1.4)

readRep: Read an ADMB Report into R Memory

Description

Import ADMB-generated report files into R's memory using the names of the report files to name the R-objects.

Usage

readRep(prefix, suffix=c(".cor",".rep",".std",".mc.dat"), global=FALSE)

Value

Invisibly returns the list of report objects. If only one report is imported, a single report object is returned.

Arguments

prefix

string name prefix of the ADMB project (e.g., "vonb").

suffix

string scalar/vector specifying one or more suffixes.

global

logical: if TRUE, save the imported reports as objects to global environment using the same names as the report files.

Author

Rowan Haigh, Program Head -- Offshore Rockfish
Pacific Biological Station (PBS), Fisheries & Oceans Canada (DFO), Nanaimo BC
locus opus: Institute of Ocean Sciences (IOS), Sidney BC
Last modified Rd: 2009-09-10

Details

If the report object is one of c(".cor", ".std", ".mc.dat"), the report object is a data frame, otherwise it is a string vector. Multiple report objects are returned as a list of objects. A single report object is returned as the object itself.

This function attempts to detect the file format from a number of possibilities. For example, if the file has the special format recognized by PBSmodelling, then the function returns a list with named components. The example vonb included with this package shows how to write the template to get consistent variable names between ADMB and R. See the User's Guide for complete details.

See Also

editADfile, .win.viewRep