mikejohnson51 / climateR

An R 📦 for getting point and gridded climate data by AOI
https://mikejohnson51.github.io/climateR/
MIT License
168 stars 40 forks source link

TOPOWX #9

Closed alisamastusgs closed 5 years ago

alisamastusgs commented 5 years ago

Could a function be added to pull data from TOPOWX?

mikejohnson51 commented 5 years ago

Hi @alisamastusgs ,

Here is an example of using the new TopoWX function in a daily and monthly context for colorado!

Please let me know if it works for you.

Thanks, Mike

library(climateR)
#> Loading required package: AOI
#> Loading required package: leaflet
library(raster)
#> Loading required package: sp

# Here we get TMAX data for Colorado on October 29, 2015 (daily)
twx = getTopoWX(getAOI(state = "CO"),
                param = 'tmax',
                startDate = "2015-10-29")

plot(twx[[1]], main = names(twx))


# Here we get average TMIN data for Colorado in October, 2015 (monthly)
twx_month = getTopoWX(getAOI(state = "CO"),
                param = 'tmin',
                startDate = "2015-10-29",
                timeRes = 'monthly')

plot(twx_month[[1]], main = names(twx_month))

Created on 2019-08-13 by the reprex package (v0.3.0)