View source: R/ECSAS.extract.R
ECSAS.extract | R Documentation |
This function will connect to the Access database, create a series of queries and import the desired information in a data frame.
ECSAS.extract(
species = NULL,
years = NULL,
cruise.ids = NULL,
lat = c(-90, 90),
long = c(-180, 180),
obs.keep = NA,
obs.exclude = NA,
sub.program = c("All", "Atlantic", "Quebec", "Arctic", "ESRF", "AZMP", "FSRS"),
intransect = NULL,
intransect.only = TRUE,
distMeth = c(14, 20),
ind.tables.only = FALSE,
ecsas.path = NULL,
ecsas.drive = "C:/Users/christian/Dropbox/ECSAS",
ecsas.file = "Master ECSAS_backend v 3.31.mdb",
debug = FALSE
)
species |
[character, default: ‘NULL’] |
years |
[integer, default: ‘NULL’] |
cruise.ids |
[integer, default: ‘NULL’] |
lat |
[numeric(2), default: ‘ |
long |
[numeric(2), default: ‘ |
obs.keep |
[character, default: ‘NA’] |
obs.exclude |
[character, default: ‘NA’] |
sub.program |
[character, default: ‘ |
intransect |
DEPRECATED - please use |
intransect.only |
[logical(1), default: ‘TRUE’] Gjerdrum, C., D.A. Fifield, and S.I. Wilhelm. 2012. Eastern Canada Seabirds at Sea (ECSAS) standardized protocol for pelagic seabird surveys from moving and stationary platforms. Canadian Wildlife Service Technical Report Series No. 515. Atlantic Region. vi + 37 pp. |
distMeth |
[integer or character, default: ‘ |
ind.tables.only |
[logical(1), default: ‘FALSE’] |
ecsas.path |
[character, default: ‘NULL’] |
ecsas.drive |
[character, default: ‘ |
ecsas.file |
[character, default: ‘ |
Using the default values of intransect.only = TRUE
and
distMeth = c(14,20)
has the side-effect of excluding data collected
under the old PIROP protocl. To include these data, set intransect.only
= FALSE
and distMeth = "All"
.
The distance traveled during the watch is returned in the column
WatchLenKm
. If lat/long coordinates are available for both the start
and end locations of the watch, then it is calculated as the shortest distance
between these two points on the WGS84 ellipsoid using geosphere::distGeo()
and, in this case, WatchLenKmHow
will contain "distGeo"
.
Otherwise WatchLenKm
is calculated as the PlatformSpeed *
CalcDurMin
where CalcDurMin
is the length of the watch in minutes
computed from start and end times. In this case, WatchLenKmHow
will
contain "Dead Reckoning"
.
By default the function will produce a data frame that contains all the pertinent information. Note that watches with no observations (the so called "zeros" are included by default).
If ind.tables.only
is FALSE
(the default), then a single
dataframe is returned containing all pertinent cruise, watch and sightings
table info for each observation. If a given watch had no observations, then
sighting related fields will be NA
.
If ind.tables.only
is TRUE
, then a list is returned with the
following elements:
watches | the combined columns from the watch and cruise tables only. |
sightings | the columns from the sightings table only. |
Note it is not currently possible to extract the watch and cruise tables separately.
Christian Roy, Dave Fifield
QC.extract
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.