swfscDAS (version 0.6.2)

das_read: Read DAS file(s)

Description

Read one or more fixed-width DAS text file(s) generated by WinCruz into a data frame, where each line is data for a specific event

Usage

das_read(file, skip = 0, ...)

Value

A das_dfr object, which is also a data frame, with DAS data read into columns. The data are read into the data frame as characters as described in 'Details', with the following exceptions:

NameClassDetails
EffortDotlogicalTRUE if "." was present, and FALSE otherwise
DateTimePOSIXctcombination of 'Date' and 'Time' columns
Latnumeric'Latitude' column converted to decimal degrees in range [-90, 90]
Lonnumeric'Longitude' column converted to decimal degrees in range [-180, 180]
Data#characterleading/trailing whitespace trimmed for non-comment events (i.e. where 'Event' is not "C")
EventNumcharacterleading/trailing whitespace trimmed; left as character for some project-specific codes
file_dascharacterbase filename, extracted from the file argument
line_numintegerline number of each data row

DateTime values have a (meaningless) time zone value of "UTC". See the OffsetGMT column from das_process

for relevant time zone information

Warnings are printed if any unexpected events have NA DateTime/Lat/Lon values, or if any Lat/Lon values cannot be converted to numeric values. Events that are 'expected' to have NA DateTime/Lat/Lon values are: C, ?, 1, 2, 3, 4, 5, 6, 7, 8

Arguments

file

filename(s) of one or more DAS files

skip

integer; see read_fwf. Default is 0

...

ignored

Details

Reads/parses DAS data into columns of a data frame. If file contains multiple filenames, then the individual data frames will be concatenated.

The provided DAS file must adhere to the following column number and format specifications:

ItemColumnsFormat
Event number1-3
Event4
Effort dot5
Time6-11HHMMSS or HHMM
Date13-18MMDDYY
Latitude20-28NDD:MM.MM
Longitude30-39WDDD:MM.MM
Data140-44
Data245-49
Data350-54
Data455-59
Data560-64
Data665-69
Data770-74
Data875-79
Data980-84
Data1085-89
Data1190-94
Data1295+

See das_format_pdf for more information about DAS format requirements, and note that 'Data#' columns may be referred to as 'Field#' columns in other documentation.

Examples

Run this code
y <- system.file("das_sample.das", package = "swfscDAS")
das_read(y)

Run the code above in your browser using DataLab