das_read {swfscDAS}R Documentation

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, ...)

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:

Item Columns Format
Event number 1-3
Event 4
Effort dot 5
Time 6-11 HHMMSS or HHMM
Date 13-18 MMDDYY
Latitude 20-28 NDD:MM.MM
Longitude 30-39 WDDD:MM.MM
Data1 40-44
Data2 45-49
Data3 50-54
Data4 55-59
Data5 60-64
Data6 65-69
Data7 70-74
Data8 75-79
Data9 80-84
Data10 85-89
Data11 90-94
Data12 95+

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.

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:

Name Class Details
EffortDot logical TRUE if "." was present, and FALSE otherwise
DateTime POSIXct combination of 'Date' and 'Time' columns
Lat numeric 'Latitude' column converted to decimal degrees in range [-90, 90]
Lon numeric 'Longitude' column converted to decimal degrees in range [-180, 180]
Data# character leading/trailing whitespace trimmed for non-comment events (i.e. where 'Event' is not "C")
EventNum character leading/trailing whitespace trimmed; left as character for some project-specific codes
file_das character base filename, extracted from the file argument
line_num integer line 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

Examples

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


[Package swfscDAS version 0.6.3 Index]