Description Usage Arguments Details Value Author(s) See Also Examples
Write an entire (Raster*TS
) object to a file.
1 |
x |
a raster time series ( |
filename |
Output filename |
overwrite |
Logical. If |
... |
Additional arguments as for
|
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.
This function is used for writing values to a series of files.
Babak Naimi
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ## 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.