if (nzchar(Sys.getenv("NOAA_TOKEN"))) {
# Retrieve your NOAA API token from environment
noaa_token <- Sys.getenv("NOAA_TOKEN")
# Get stations for the GHCND dataset in Texas between 2020-01-01 and 2020-12-31
stations <- get_stationid(
noaa_token = noaa_token,
datasetid = "GHCND",
locationid = "FIPS:48",
startdate = "2020-01-01",
enddate = "2020-12-31"
)
head(stations)
}
Run the code above in your browser using DataLab