This is an R Markdown document. Markdown demonstates the basic sentinel processing using r https://www.rspatial.org.
The main packages we are going to be using here are basically the ratser and egdal nstalling them ifnot availlable .to install remember to type each in the console and hit enter then wait until it completes download then go ahead to install the other
#install.packages("raster")
#ininstall.packages("rgdal")
write the bellow commands to load the libraries
#loading required packages for raster handling purposes
library(raster) #this is used for raster data handling and processing
## Loading required package: sp
library(rgdal)#solves difficulties by reading the variouse formats
## rgdal: version: 1.5-12, (SVN revision 1018)
## Geospatial Data Abstraction Library extensions to R successfully loaded
## Loaded GDAL runtime: GDAL 3.0.4, released 2020/01/28
## Path to GDAL shared files: C:/Users/ShellHunter.DESKTOP-EO423F6/Documents/R/win-library/4.0/rgdal/gdal
## GDAL binary built with GEOS: TRUE
## Loaded PROJ runtime: Rel. 6.3.1, February 10th, 2020, [PJ_VERSION: 631]
## Path to PROJ shared files: C:/Users/ShellHunter.DESKTOP-EO423F6/Documents/R/win-library/4.0/rgdal/proj
## Linking to sp version:1.4-2
## To mute warnings of possible GDAL/OSR exportToProj4() degradation,
## use options("rgdal_show_exportToProj4_warnings"="none") before loading rgdal.
setwd("C:/Users/ShellHunter.DESKTOP-EO423F6/Documents/rstudio/raster processing/data")
this dependes on the file format of the bands whether its .jpg, .tiff, .grd e.t.c funtion used list.files()
bands<- list.files(recursive = TRUE, full.names = TRUE,pattern = ".tif")
this can can be achieved by using the length function length()
length(bands)
## [1] 2
this can can be achieved by using the head function head()
head(bands)
## [1] "./s1b-iw-grd-vh-20190408t183312-20190408t183337-015719-01d7eb-002.tiff"
## [2] "./s1b-iw-grd-vv-20190408t183312-20190408t183337-015719-01d7eb-001.tiff"
band2<-bands[2]# specifying the band number
#plot(band2)#ploting the band
use question mark followed by the function you want to understand ?plot
#?plot
To achieve this use the function stack()
#sentinelstack<-stack(bands)
To achieve this use the function par(mfrow=c())
par(mfrow=c(2,2))
To achieve this use the function `plotRGB()``
#plotRGB(sentinelstack, 4,3,2, scale=65535, stretch='lin')