| update.divdata {climdiv} | R Documentation |
Connects to NOAA's website and downloads a current raw climate division data set; formats data as an array. For most purposes, update.divdata() is recommended. update.divdata() archives the climate division data sets as R data sets, obtainable via a call to the data() statement in R (eg data(divdat.pdsi), data(divdat.tmp), etc.)
The new data set is either saved as an updated R data set in the climdiv library, callable via /code{data()}, or else returned in a list.
update.divdata(type = c("pdsi", "phdi", "pmdi", "zndx", "pcp", "tmp"), update = TRUE)
type |
the type of data to download. one or more of c("pdsi", "phdi", "pmdi", "zndx", "pcp", "tmp") |
update |
true or false |
update.divdata has two modes. If update = FALSE, then only one data set can be specified at a time for downloading, and the value returned is a list named divdata with two components:
type: describes the type of data (one of pdsi, phdi, etc.) returned
data: an array with year, month, and data for each climate division in columns (see format description below)
If update = TRUE (the default), then one or more of the listed data sets can be specified (the default is all six). The specified data sets are then downloaded, formated, and saved in the climdiv library. They are accessible via a call to data(). No value is returned by the function update.divdata.
Data sets available for download are
pdsi Palmer Drought Severity Index by Climate Division phdi Palmer Hydrological Drought Index by Climate Division pmdi Modified Palmer Drought Severity Index by Climate Division zndx Palmer Z Index by Climate Division pcp Precipitation by Climate Division tmp Temperature by Climate Division
Data are monthly from 1895 to the most recent month.
Returns a data array containing the current pdsi data set in a
convenient array, of the form
year month ST01 ST02 ST03 . . .
19XX 1
19XX 2
19XX 3
. .
. .
. .
where the first column is the year, the second is the month, and each remaining column contains data for a single climate division.
no value is returned when update = TRUE. The downloaded data set is archived in the climdiv library, accessible via data().
The first five years or so of the drought indices should not be used, since the Palmer is autoregressive.
This function is only going to work on a computer connected to the internet....
~~further notes~~
Anthony L. Westerling
http://tenaya.ucsd.edu/~westerli/westerling.html
for more information on this data set, see
http://lwf.ncdc.noaa.gov/oa/climate/onlineprod/drought/ftppage.html
this is also usefull for checking to see if the filename has been changed, etc.
#updates all six data sets and saves them in the climdiv library
# update.divdata()
# data(divdat.pdsi)
#retrieves one data set and returns it as a list
# divdat.pdsi=update.divdata('pdsi',update=F)