29 abr 2021

Working with the Soilspec data (part 1)

Once I have loaded the Soilspec package, it is time to start looking to the data.  The data is called "datsoilspc" which has 391 soil samples in the VIS-NIR range (from 350 to 2500 nm) with reference values for the texture parameters (Sand, Clay and Silt) and for the total carbon.

As we have done with other data, now we can load  in R, and after we can plot the raw spectra:

data('datsoilspc')
spectra<-datsoilspc$spc
matplot(wavelengths, t(spectra), type = "l",
        xlab = "wavelength", ylab = "Reflectance")

 

 

Due to the scatter we don´t se clearly the absortion band, so let´s apply a
Standard Normal Variate scatter correction:

spectra_snv<-scale(t(spectra),center=TRUE,scale=TRUE)
matplot(wavelengths, spectra_snv, type = "l",
        xlab = "wavelength", ylab = "Reflectance")

We can see the absortions around 1400, 1900 and 2200 nm, but there is more information in the visible range that we will try to understand.

We can see the histograms for sand, clay, silt and total carbon:

hist(datsoilspc$clay, main = "Clay")
hist(datsoilspc$sand, main = "Sand")

hist(datsoilspc$silt, main = "Silt")
hist(datsoilspc$TotalCarbon, main = "Total Carbon")

Let´s see what I can doo with all this data in coming posts.


 

No hay comentarios:

Publicar un comentario