airdas_segdata {swfscAirDAS} | R Documentation |
Summarize AirDAS data for a continuous effort section
Description
Summarize AirDAS effort data by effort segment, while averaging conditions
Usage
airdas_segdata(x, ...)
## S3 method for class 'data.frame'
airdas_segdata(x, ...)
## S3 method for class 'airdas_df'
airdas_segdata(
x,
conditions,
segdata.method = c("avg", "maxdist"),
seg.lengths,
section.id,
...
)
Arguments
x |
|
... |
ignored |
conditions |
see |
segdata.method |
character; either |
seg.lengths |
numeric; length of the modeling segments
into which |
section.id |
numeric; the ID of |
Details
WARNING - do not call this function directly! It is exported for documentation purposes, but is intended for internal package use only.
This function was designed to be called by one of the airdas_chop_ functions,
e.g. airdas_chop_equallength
, and thus
users should avoid calling it themselves.
It loops through the events in x
, calculating and storing relevant
information for each modeling segment as it goes.
Because x
is a continuous effort section, it must begin with
a "T" or "R" event and end with the corresponding "E" or "O" event.
For each segment, this function reports the
segment ID, transect code, the start/end/mid coordinates (lat/lon),
start/end/mid date/times (DateTime), segment length,
year, month, day, time, observers,
and average conditions (which are specified by conditions
).
The segment ID is designated as section.id
_ index of the modeling segment.
Thus, if section.id
is 1
, then the segment ID for
the second segment from x
is "1_2"
.
When segdata.method
is "avg"
, the condition values are
calculated as a weighted average by distance.
The reported value for logical columns (e.g. Haze) is the percentage
(in decimals) of the segment in which that condition was TRUE
.
For character columns, the reported value for each segment is
the unique value(s) present in the segment, with NA
s omitted,
pasted together via paste(..., collapse = "; ")
.
When segdata.method
is "maxdist"
, the reported values
are, for each condition, the value recorded for the longest distance
during that segment (with NA
s omitted).
Transect code, file name, and vent code that started the continuous effort section
are also included in the segdata output.
These values (excluding NA
s) must be consistent across the
entire effort section, and thus across all segments in x
;
a warning is printed if there are any inconsistencies.
bearing
and destination
are used to calculate the segment start, mid, and end points,
with method = "vincenty"
.
Value
Data frame with the segdata information described above
and in airdas_effort