
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)
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
a dataframe with UTC
, Latitude
, and Longitude
columns
AIS data created using the readLocalAIS function. Can also be a character listing the directory of AIS
distance (meters) within locations in x
to mark
as "nearby"
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)
Run the code above in your browser using DataLab