Unlimited learning, half price | 50% off

Last chance! 50% off unlimited learning

Sale ends in


envirem (version 2.3)

verifyFileStructure: Verify File Structure

Description

Ensures that the necessary files are present for other functions to work properly.

Usage

verifyFileStructure(
  path = "./",
  returnFileNames = TRUE,
  includeSolRad = TRUE,
  rasterExt = ".tif"
)

Value

Prints messages to the console if problems are found. If returnFileNames == TRUE, then a vector of filenames is returned.

Arguments

path

path to directory of rasters

returnFileNames

logical, should file paths and names be returned

includeSolRad

logical, should solar radiation files be required?

rasterExt

file extension of rasters

Author

Pascal Title

Details

This function searches for the following in the directory specified by path:

12 precipitation rasters

12 min temperature rasters

12 max temperature rasters

12 mean temperature rasters [optional]

12 solar radiation rasters

The naming scheme will be checked against the one defined via the custom naming environment. See link{?assignNames} for additional details.

An equivalent function for checking the names of rasters in R can be found at verifyRasterNames.

If mean temperature rasters are not detected, the raster creation functions will create mean temperature by taking the mean of the min and max.

Examples

Run this code
rasterPath <- system.file('extdata', package='envirem')
list.files(rasterPath)

# Assign naming scheme
assignNames(precip = 'prec_##')
varnames()

# As there are no problems with these files, the list of files 
# will be returned.
verifyFileStructure(rasterPath)

assignNames(reset = TRUE)

Run the code above in your browser using DataLab