November 2018
Beginner to intermediate
354 pages
6h 59m
English
We can stack multiple rasters using the stack() function. This allows us to read and store multiple bands in R simultaneously. We'll now read and stack bands numbered 1 to 5 using the stack() function:
band1 = raster("Mosaic/LC08_L1TP_137043_20180410_20180417_01_T1/LC08_L1TP_137043_20180410_20180417_01_T1_B1.TIF")band2 = raster("Mosaic/LC08_L1TP_137043_20180410_20180417_01_T1/LC08_L1TP_137043_20180410_20180417_01_T1_B2.TIF")band3 = raster("Mosaic/LC08_L1TP_137043_20180410_20180417_01_T1/LC08_L1TP_137043_20180410_20180417_01_T1_B3.TIF")band5 = raster("Mosaic/LC08_L1TP_137043_20180410_20180417_01_T1/LC08_L1TP_137043_20180410_20180417_01_T1_B5.TIF")stacked = stack(band1, band2, band3, band4, band5)
Now we can see plots ...
Read now
Unlock full access