Skip to content
Prev 14852 / 29559 Next

create a TS with multiple raster files

Jacob van Etten <jacobvanetten at yahoo.com> writes:
Another approach is to pass the result of list.files directly to stack
(if I am not wrong you do not want the first file to be included, that's
why I use [-1]):

library(raster)

rst <- list.files(pattern='*.rst')
s <- stack(rst[-1])

If this stack is a space-time data you can use the setZ function. If idx
is the time index of the data:

s <- setZ(s, idx)

Best,

Oscar.
-------------- next part --------------
Message-ID: <87hawhbbyu.fsf@gmail.com>
In-Reply-To: <1334673430.50258.YahooMailNeo@web29702.mail.ird.yahoo.com> (Jacob van Etten's message of "Tue, 17 Apr 2012 15:37:10 +0100 (BST)")