Dear Nora,

The best thing would be to read the vignette of the raster package first.

A combination of raster layers is not a data frame, but a stack.

This is how you make one, following your example:


st <- get(list.files(pattern='*.rst')[1])

for (f in list.files(pattern='*.rst')[-1]) {st <- stack(st, get(f))}


plot(st)

Best,

Jacob.


________________________________
 From: Nora Schmid <noerchen306@gmail.com>
To: r-sig-geo@r-project.org 
Sent: Tuesday, 17 April 2012, 9:25
Subject: [R-sig-Geo] create a TS with multiple raster files

Hello,

I´m new in R and don´t have lots of experiences with programming...
I´m trying to create a time series:
I read my raster data with the following:

for (f in list.files(pattern='*.rst')){assign(f, raster(f))}

How can I create afterwards a time series with the files I loaded? How
can I assign all files to one data frame? Whats the best way to create
from multiple raster files on time series?

Thanks a lot in advance,

yours

Nora

    [[alternative HTML version deleted]]


_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
	[[alternative HTML version deleted]]

