write.rts: Write raster time Series data to a file

write.rtsR Documentation

Write raster time Series data to a file

Description

Write an entire (Raster*TS) object to a file.

Usage

write.rts(x, filename, overwrite=FALSE, ...) 

Arguments

x

a raster time series (Raster*TS) object created by rts

filename

Output filename

overwrite

Logical. If TRUE, "filename" will be overwritten if it exists

...

Additional arguments as for writeRaster:

datatype Character. utput data type (e.g. 'INT2S' or 'FLT4S'). See dataType. If no datatype is specified, 'FLT4S' is used.

bandorder: Character. 'BIL', 'BIP', or 'BSQ'.

Details

This function writes a raster time series object into a directory which named as is specified in the filename argument. To write the raster data, writeRaster in the package raster is used. The function writes the time information into a separate ascii file.

Value

This function is used for writing values to a series of files.

Author(s)

Babak Naimi

naimi.b@gmail.com

https://r-gis.net/

See Also

read.rts, writeRaster

Examples


## Not run: 
path <- system.file("external", package="rts") # location of files

lst <- list.files(path=path,pattern='.asc$',full.names=TRUE)
lst # list of raster files


r <- stack(lst) # creating a RasterStack object

d <- c("2000-02-01","2000-03-01","2000-04-01","2000-05-01") # corresponding dates to 4 rasters
d <- as.Date(d) # or d <- as.POSIXct(d) 

n <- rts(r,as.Date(d)) # creating a RasterStackTS object

write.rts(n,"nf") # writing n into the working directory

rt <- read.rts("nf") # reading nf from the working directory

rt


## End(Not run)


rts documentation built on Oct. 1, 2023, 9:07 a.m.

Related to write.rts in rts...