View source: R/addAISSummary.R
addAISSummary | R Documentation |
Adds a summary of matching AIS data for nearby vessels to a data. Information added includes number of vessels, distance to nearby vessels, and average speed of nearby vessels
addAISSummary(x, ais, distance = 10000)
x |
a dataframe with |
ais |
AIS data created using the readLocalAIS function. Can also be a character listing the directory of AIS |
distance |
distance (meters) within locations in |
a dataframe with AIS summary data added. Will contain new columns
the number of ships within "distance" at this time
average distance of nearby ships, NA if none
average speed over ground of nearby ships, NA if none
distance of the closest ship, NA if none
speed over ground of closest ship, NA if none
Taiki Sakai taiki.sakai@noaa.gov
gps <- data.frame(Latitude=c(33.2, 33.5,33.6),
Longitude=c(-118.1, -118.4, -119),
UTC=as.POSIXct(
c('2022-04-28 05:00:00',
'2022-04-28 10:00:00',
'2022-04-28 20:00:00'),
tz='UTC'))
ais <- readLocalAIS(gps, system.file('extdata/ais', package='PAMscapes'))
aisSummary <- addAISSummary(gps, ais)
str(aisSummary)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.