Learn R Programming

geotopbricks (version 1.5.8.2)

write.ascii.vectorized.brick: 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,
  ...
)

Value

the string vector possibly written in file.

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

See Also

read.ascii.vectorized.brick

Examples

Run this code
## 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

Run the code above in your browser using DataLab