readINCABIL: Read a binary INCA file

View source: R/readINCABIL.r

readINCABILR Documentation

Read a binary INCA file

Description

Read an INCA file in the BIL format from a .tar.gz archive.

Usage

readINCABIL(
  filename,
  times = "first",
  date = NULL,
  remove = FALSE,
  CoSys = NULL,
  ex = NULL,
  tz = "utc",
  form = "stack"
)

Arguments

filename

A character string to the file to be read in

times

A character string giving the element of the BIL file to be read in. One of 'first', 'last', 'all', 'date'. See details.

date

A POSIXct date or NULL. Only evaluated if times == date

remove

Logical. Remove the processed files?

CoSys

A character string giving the coordinate system of the raster or NULL.

ex

Either an extent, a numerical vector that can be coerced to an extent object or NULL.

tz

A character string giving the time zone

form

A character string. May be either 'list' or 'stack'

Details

Both uncompressed and compressed (.tar.gz) files can be processed. If uncompressed, only the filename without extension must be provided.#'

Value

A named (date and time) list with rasters if form == 'list', or, if form == 'stack' a raster stack

Author(s)

Simon Frey

See Also

raster readBin proj4string crs writeINCABIL extent

Examples

   # file to load
   file <- paste(path.package("ZAMGR"),"/extdata/INCA_TT.tar.gz",sep="")

   # reading a compressed file
   x <- readINCABIL(file)

   # plot the results
   plot(x[[1]])

   # compress first and then read
   file <- untar(file, exdir = tempdir())
   file <- dir(path = tempdir(), pattern = ".bil", full.names = TRUE)
   x <- readINCABIL(file = gsub(".bil", replacement = "", file), times = "all")

freysimon/ZAMGR documentation built on Nov. 3, 2023, 9:44 p.m.