if (FALSE) {
# Get all annual average temperature data from 1990 to 2000 at default resolution
get_prism_annual(type = "tmean", years = 1990:2000, keepZip = FALSE)
# Get annual precipitation for multiple years at 800m resolution
get_prism_annual(
type = "ppt",
years = 2020:2022,
resolution = "800m",
keepZip = FALSE
)
# Get single year of annual temperature data at high resolution
get_prism_annual(
type = "tmax",
years = 2023,
resolution = "800m",
keepZip = TRUE
)
# will fail - invalid resolution:
get_prism_annual(
type = "tmean",
years = 2023,
resolution = "1km",
keepZip = FALSE
)
}
if (FALSE) {
# get daily average temperature data for June 1 - 14, 2013 at 4km resolution
get_prism_dailys(
type = "tmean",
minDate = "2013-06-01",
maxDate = "2013-06-14",
keepZip = FALSE
)
# get precipitation data for June 1, 2013 at 800m resolution
get_prism_dailys(
type = "ppt",
dates = "2013/06/01",
resolution = "800m",
keepZip = FALSE
)
# get average temperature for three specific days at default resolution
get_prism_dailys(
type = "tmean",
dates = c("2013-06-01", "2013-06-14", "2014-06-30"),
keepZip = FALSE
)
# get high-resolution daily maximum temperature for a date range
get_prism_dailys(
type = "tmax",
minDate = "2013-06-01",
maxDate = "2013-06-07",
resolution = "800m",
keepZip = FALSE
)
# will fail - both minDate and dates specified:
get_prism_dailys(
type = "ppt",
minDate = "2013-06-01",
dates = "2013-06-14",
keepZip = FALSE
)
# will fail - minDate without maxDate:
get_prism_dailys(
type = "ppt",
minDate = "2013-06-01",
keepZip = FALSE
)
# will fail - invalid resolution:
get_prism_dailys(
type = "tmean",
dates = "2013-06-01",
resolution = "1km",
keepZip = FALSE
)
}
if (FALSE) {
# Get all the precipitation data for January from 1990 to 2000 at 4km resolution
get_prism_monthlys(type = "ppt", years = 1990:2000, mon = 1, keepZip = FALSE)
# Get January-December 2005 monthly precipitation at default resolution
get_prism_monthlys(type = "ppt", years = 2005, mon = 1:12, keepZip = FALSE)
# Get high-resolution monthly temperature data for summer months
get_prism_monthlys(
type = "tmean",
years = 2023,
mon = 6:8,
resolution = "800m",
keepZip = FALSE
)
# Get multiple years of winter precipitation at 800m resolution
get_prism_monthlys(
type = "ppt",
years = 2020:2022,
mon = c(12, 1, 2),
resolution = "800m",
keepZip = TRUE
)
# will fail - invalid resolution:
get_prism_monthlys(
type = "ppt",
years = 2023,
mon = 6,
resolution = "1km",
keepZip = FALSE
)
}
if (FALSE) {
# Get 30 year normal values for January rainfall
get_prism_normals(type = "ppt", resolution = "4km", mon = 1, keepZip = FALSE)
# Get monthly (every month) and annual 30-year normals for mean temperature
get_prism_normals(
type = "tmean",
resolution = "800m",
mon = 1:12,
annual = TRUE,
keepZip = FALSE
)
# Get daily precip normals for January 1 and March 1
get_prism_normals('ppt', '4km', NULL, FALSE, TRUE, c('0101', '0301'))
# Get daily precip normals for all of February
get_prism_normals('ppt', '4km', 2, FALSE, TRUE, TRUE)
# Get July 2nd average temperature 30-year average
get_prism_normals('tmean', '800m', NULL, FALSE, TRUE, as.Date('2000-07-02'))
}
Run the code above in your browser using DataLab