Description Usage Arguments Details Examples
View source: R/sp_extract_pt.R
Extract environmental data - pt based
1 | sp_extract_pt(x, from = "noaa_isd", radius = 50, select = "first", date = NULL)
|
x |
input data.frame |
from |
which data source, only 'noaa_isd' for now OR an object with data in it, including data.frame or SpatialPointsDataFrame |
radius |
radius, in km, for which to search for stations/point locations
from each input point in |
select |
Ignored right now |
date |
Date to search for data for. Ignored if you supply your own
env data in |
Works for the use case of finding locations for point based stations, e.g., floats/buoys type data
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ## Not run:
file <- system.file("examples", "obis_mola_mola.csv", package = "spenv")
dat <- read.csv(file, stringsAsFactors = FALSE)
head(dat)
# data.frame input
res <- sp_extract_pt(x = dat[1:10,], radius = 10)
dplyr::bind_rows(res)
# spatial objects
## SpatialPointsDataFrame - w/ NOAA remote data
library("sp")
coordinates(dat) <- ~longitude + latitude
sp_extract_pt(dat, radius = 10)
## SpatialPointsDataFrame - w/ data.frame
file <- system.file("examples", "noaa_data.csv", package = "spenv")
ref <- read.csv(file, stringsAsFactors = FALSE)
sp_extract_pt(x = dat, from = ref, radius = 10)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.