getPRISMGrid: PRISM Grid Download Function

Description Usage Arguments Details Value Examples

Description

This function downloads a PRISM weather data grid to disk or the R-environment. A .RData file containing download info is also provided. If downloading to disk, .bil files are downloaded; if downloading to the R-environment, a SpatialGridDataFrame is downloaded.

Usage

1
getPRISMGrid(date, type, range = "daily", spGrid = TRUE)

Arguments

date

An 8 character date string 'yyyymmdd' for daily or a 6 character date string 'yyyymm' for monthly.

type

A string denoting the datatype to be downloaded. "tmax", "tmin", "ppt".

range

String "daily" or "monthly".

spGrid

logical for SpatialGridDataFrame return value vs storing in working directory. Default is TRUE.

Details

The data these scripts use are subject to the PRISM Gridded Climate Data - Terms of Use. As of 07/06/2014, these are available at http://www.prism.oregonstate.edu/documents/PRISM_terms_of_use.pdf NOTE in particular the Data section: 'All data (gridded, polygon, tabular, graphical) retrieved from the website or otherwise provided on the website may be freely reproduced and distributed for non-commercial purposes.

When referring to the data, the source must be clearly and prominently stated and include, at a minimum, our name, URL, and the date of data creation. For example: PRISM Climate Group, Oregon State University, http://prism.oregonstate.edu, created 4 Feb 2004.

Sale or other commercial use of the data must be arranged by contacting the PRISM Climate Group.'

Value

Either a SpatialGridDataFrame from the sp package (spGrid==TRUE) or the bil and associated files are stored in the working directory and the function returns TRUE/FALSE depending on the success of the unzipping. The current naming convention for the bil files (as of 12/13/2013) are for daily: "PRISM_type_stable_4kmD1_yyyymmdd_bil.bil" e.g. "PRISM_tmax_stable_4kmD1_19990101_bil.bil" and monthly: "PRISM_type_stable_4kmM2_yyyymm_bil.bil"

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
grid1 <- getPRISMGrid(date="19990101", type="tmax", range="daily",
  spGrid=TRUE)
grid2 <- getPRISMGrid(date="199901",
  type="tmax", range="monthly", spGrid=TRUE)
setwd("C:/mydir")
getPRISMGrid(date="19990101",
type="tmax", range="daily", spGrid=FALSE)

## End(Not run)

kendonB/prismUtils documentation built on May 20, 2019, 9:04 a.m.