Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
次のようなループでいくつかのラスターをスタックする必要があります。
for(month in 1:12){ . . . "some algorithm spiting out a raster called 'sm_esa'" sm_esa_stack<-stack(sm_esa) }
最後に、12 層 (それぞれ 1 か月) のスタックを作成したいと思います。しかし、私の最後の行は、スタックするのではなく、新しいラスターごとに明らかに上書きします。ヒントはありますか?
ループの外側で空のスタックをインスタンス化し、ループを反復するたびに、現在のスタックと新しい Rasterlayer の両方をスタックして、新しい rasterLayer をスタックに追加します。
x <- stack() for(month in 1:12){ . . . "some algorithm spiting out a raster called 'sm_esa'" x <- stack( x , sm_esa ) }