View source: R/prism_archive_verify.R
prism_archive_verify | R Documentation |
prism_archive_verify()
checks the data in the prism archive to ensure it
is valid, or at least can be read into R, i.e., it is not corrupt. The
prism variable type, time period, etc. is specified the same as for
prism_archive_subset()
. Any files that are not readable can automatically
be re-downloaded.
check_corrupt()
is the deprecated version of
prism_archive_verify()
prism_archive_verify(
type,
temp_period,
years = NULL,
mon = NULL,
minDate = NULL,
maxDate = NULL,
dates = NULL,
download_corrupt = TRUE,
keepZip = TRUE
)
check_corrupt(type, minDate = NULL, maxDate = NULL, dates = NULL)
type |
The type of data you want to subset. Must be "ppt", "tmean", "tmin", "tmax", "tdmean", "vpdmin", "vpdmax", "solclear", "solslope", "soltotal", or "soltrans". |
temp_period |
The temporal period to subset. Must be "annual", "monthly", "daily", "monthly normals", or "annual normals". |
years |
Valid numeric year, or vector of years. |
mon |
Valid numeric month, or vector of months. |
minDate |
Date to start subsetting daily data. Must be specified in a valid iso-8601 (e.g. YYYY-MM-DD) format. May be provided as either a character or base::Date class. |
maxDate |
Date to end subsetting daily data. Must be specified in a valid iso-8601 (e.g. YYYY-MM-DD) format. May be provided as either a character or base::Date class. |
dates |
A vector of daily dates to subset. Must be specified in a valid iso-8601 (e.g. YYYY-MM-DD) format. May be provided as either a character or base::Date class. |
download_corrupt |
If |
keepZip |
If |
Under the hood, it uses raster::stack()
and then raster::rasterToPoints()
to determine if the bil files are readable. If both those files are able
to successfully read the files, they are assumed to be valid/readable.
prism_archive_verify()
returns TRUE
if all data are readable.
Any prism data that are not readable are returned (folder names), whether
they are re-downloaded or not.
check_corrupt()
returns logical
indicating whether the process
succeeded.
## Not run:
# check all annual precipitation data from 2000-2023 are readable
# x will contain any corrupt files, or be TRUE if they are all readable
x <- prism_archive_verify('ppt', 'annual', 2000:2023)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.