data(spectral_data)
## Mask channel crossing part (arround 1050 nm) and strong
## water absorption part (above 1350 nm)
mask(spectral_data) <- c(1045, 1055, 1350, 1706)
## Calculate SAM distances (object of class 'dist')
sam_dist <- dist.speclib(subset(spectral_data, season == "summer"))
## Convert to class 'distMat3D'
sam_dist <- distMat3D(as.matrix(sam_dist))
sam_dist
Run the code above in your browser using DataLab