airdas_check {swfscAirDAS} | R Documentation |
Check AirDAS file
Description
Check that AirDAS file has accepted formatting and values
Usage
airdas_check(
file,
file.type = c("turtle", "caretta", "phocoena"),
skip = 0,
file.out = NULL,
sp.codes = NULL,
print.transect = TRUE
)
Arguments
file |
filename(s) of one or more AirDAS files |
file.type |
character; indicates the program used to create |
skip |
integer: see |
file.out |
character; filename to which to write the error log.
Should be a text or CSV file. Default is |
sp.codes |
character; filename of .dat file from which to read
accepted species codes.
If |
print.transect |
logical; indicates if a table with all the
transect numbers in the |
Details
The default (internal) sp.codes
file is located at
system.file("SpCodesAirDAS.dat", package = "swfscAirDAS")
.
To see the checks performed by this function, you can access the PDF locally at
system.file("AirDAS_check.pdf", package = "swfscAirDAS")
,
or online at https://github.com/smwoodman/swfscAirDAS/blob/master/inst/AirDAS_check.pdf
Checks that are not done by this function that may be of interest:
Check for valid fish ball/mola/jelly/crab pot codes
Check that datetimes are sequential, meaning they 1) are the same as or 2) come after the previous event
Value
A data frame with five columns that list information about errors found
in the AirDAS files: the file name, line number,
index (row number) from the airdas_read(file)
data frame,
'ID' (pre-Data# columns from the DAS file), and description of the issue.
This data frame is sorted by the 'Description' column.
If there are multiple issues with the same line, the issue descriptions
are concatenated together using paste(..., collapse = "; ")
If print.transect
is TRUE
, then the output of
table(x$Data1[x$Event == "T"], useNA = "always")
,
where x
is the output of airdas_read(file, ...)
is printed
If file.out
is not NULL
, then the error log is also
written to the file (e.g., a .txt or .csv file) specified by file.out
See Also
https://smwoodman.github.io/swfscAirDAS/
Examples
y <- system.file("airdas_sample.das", package = "swfscAirDAS")
if (interactive()) airdas_check(y, print.transect = TRUE)