Closed minheeseo closed 5 years ago
thanks @minheeseo for this
just for reproducible code (it didnt' work for me, and to reduce multiple calls to ghcnd_search
):
dat <- read.table(header = TRUE, sep = ",",
text = "longitude,latitude,id\n23.894614,52.744313,712")
xx <- ghcnd_stations()
normal_station <- meteo_nearby_stations(dat,
lat_colname = "latitude", lon_colname = "longitude",
station_data = xx, var = "NORMAL_DLY", year_min = 2010,
year_max = 2010, radius = 100, limit=30)
#> $`712`
#> # A tibble: 1 x 5
#> id name latitude longitude distance
#> <chr> <chr> <dbl> <dbl> <dbl>
#> 1 NA NA NA NA NA
meteo_nearby_stations(dat,
lat_colname = "latitude", lon_colname = "longitude",
station_data = xx, var = "NORMAL_DLY", year_min = 2000,
year_max = 2000, radius = 100, limit=30)
#> $`712`
#> # A tibble: 1 x 5
#> id name latitude longitude distance
#> <chr> <chr> <dbl> <dbl> <dbl>
#> 1 NA NA NA NA NA
The meteo*
functions are only for the dataset GHCND, see the datasets table in the readme https://github.com/ropensci/rnoaa#noaa-ncdc-datasets - and the var
parameter you used is for parameters, or types of data, not types of datasets.
To get stations for NORMAL_DLY
data, e.g., try
# note that data for NORMAL_DLY is only avail. for the year 2010
ncdc_datasets()$data
# an eg request
# note that the parameters are different, extent instead of radius
ncdc_stations(datasetid = 'NORMAL_DLY',
startdate='20100101', enddate='20101231',
extent = c(45.5204, -132.2047, 50.6139, -100.1065))
Right. I meant to ask about DLY-TAVG-NORMAL
from NORMAL_DLY
data. @sckott Thank you so much for the example, and I really appreciate your help!
does this solve your problem?
For the first question. For the second one, I was able to access 1971-2000 Daily Normal data via FTP (ftp://ftp.ngdc.noaa.gov/). Thanks!
Hi, I am trying to retrieve normal temperature data using rnoaa r package, and I have two questions.
dat <- read.table(header = TRUE, sep = ",", text = " longitude, latitude, id 23.894614, 52.744313,712")
normal_station <- meteo_nearby_stations(dat, lat_colname = "latitude", lon_colname = "longitude", station_data = ghcnd_stations(), var = "NORMAL_DLY", year_min = 2010, year_max = 2010, radius = 100, limit=30)
previous_normal<- meteo_nearby_stations(dat, lat_colname = "latitude", lon_colname = "longitude", station_data = ghcnd_stations(), var = "NORMAL_DLY", year_min = 2000, year_max = 2000, radius = 100, limit=30)