sst_to_points: SST data extracted to spatial points

View source: R/sst_to_points.R

sst_to_pointsR Documentation

SST data extracted to spatial points

Description

SST data extracted to spatial points

Usage

sst_to_points(
  year = "2013",
  month = "01",
  day = "01",
  ts = c("daily", "biweekly", "monthly", "custom"),
  time.range = NULL,
  spatd,
  sst.grad = FALSE,
  epsg = NULL
)

Arguments

year

A character string.

month

An integer.

day

An integer.

ts

A character string of either: daily, biweekly, monthly or custom. 'daily' will return SST for the specified date, 'biweekly' will return mean, median and sd of SST for 2 weeks around the specified date (1 week on each side), 'monthly will return mean, median and sd of SST for 4 weeks around the specified date (2 weeks on each side). 'custom' will return mean, median and sd of SST for a custom date range as defined by the "time.range" argument.

time.range

(only works with ts='custom') A vector of date-time strings in the form c("YYYYMMDD","YYYYMMDD") where the first element is the start time, and the second element is the finish time.

spatd

A spatial points dataframe.

sst.grad

A boolean. TRUE will add the spatial gradient of SST

epsg

An integer. The EPSG number for the desired projection returned by the function

Value

A spatial points dataframe with a SST column(s) appended.

Examples


spatd <- raster::shapefile("/shapedata.shp")

## Then one of:
spatd <- sst_to_points(year="2013",month="01",day="01",ts="daily",spatd=spatd,sst.grad=TRUE,epsg=4326)

spatd <- sst_to_points(year="2015",month="01",day="01",ts="biweekly",spatd=spatd,sst.grad=TRUE,epsg=4326)

spatd <- sst_to_points(year="2015",month="01",day="01",ts="monthly",spatd=spatd,sst.grad=TRUE,epsg=4326)

spatd <- sst_to_points(year="2015",month="01",day="01",ts="custom",time.range=c('20150305','20150318'),spatd=spatd,sst.grad=TRUE,epsg=4326)


HiDef-Aerial-Surveying/HDsst documentation built on March 10, 2023, 10:33 a.m.