write.ascii.vectorized.brick: Writes a z-layer brick referred to a time instant (e.g. date)...

View source: R/write.ascii.vectorizrerd.brick.R

write.ascii.vectorized.brickR Documentation

Writes a z-layer brick referred to a time instant (e.g. date) in an ascii format like 'geotop.inpts' file.

Description

Writes a z-layer brick referred to a time instant (e.g. date) in an ascii format like 'geotop.inpts' file.

Usage

write.ascii.vectorized.brick(
  b,
  file = NULL,
  header = NULL,
  overwrite = TRUE,
  NAflag = -9999,
  matlab.syntax = FALSE,
  ...
)

Arguments

b

a RasterBrick-class or GeotopRasterBrick-class object

file

file name to write

header

character string vector for header text lines. If missing, a default header is written. #Default is c("! header").

overwrite

logical. Default is TRUE, see writeRaster.

NAflag

numeric. Default is -9999, see writeRasterxGEOtop.

matlab.syntax

logical value. Default is FALSE. If TRUE the file syntax is like the one of a *.m Matlab script file.

...

further aguments inserted as attribute

Value

the string vector possibly written in file.

Note

Add Quote if necessary. This function is NOT maintained and will be DEPRECATED.

See Also

read.ascii.vectorized.brick

Examples

## Not Run
## library(geotopbricks)
## library(raster)
## file <- system.file("doc/examples/snowthickness",package="geotopbricks")
## file <- paste(file,"SnowThickness0000L%04d.asc",sep="/")
## b <- brick.decimal.formatter(file=file,nlayers=15)
## nlayers(b)
## names(b)
## file <- "snow.txt"
## btext <- write.ascii.vectorized.brick(b,Date="1/1/2009",file="snow.txt")
## The printed object
## str(btext)
## bb <- read.ascii.vectorized.brick(file = file) 
## bf <- abs(as.matrix(bb[[1]]-b[[1]]))<.Machine$double.eps^0.5

geotopbricks documentation built on May 29, 2024, 8:10 a.m.