Introduction to visa" In visa: Vegetation Imaging Spectroscopy Analyzer



S4 class Spectra and SpectraDatabase

There are already a lot of r packages for spectral data analysis, and some of them use the S4 class, e.g. the hsdar package. visa also supports the S4 format but in a simplified version, using only five slots currently.

# check the data type of NSpec.DB
class(NSpec.DB)
class(NSpec.DB@spectra)


Notice that the small difference of accessing data in two types of data, i.e., using $ and @, respectively. Functions Computing correlation matrix The first idea of writing this package was to compute the correlation matrix for the thorough analysis of correlations between, on one hand, the combinations of spectral bands, and on the other hand, the vegetation variables of interest. Here gives the example using the cm.nsr function, which can be used for non-spectra data as well. library(visa) data(NSpec.DF) x <- NSpec.DF$N # nitrogen
S <- NSpec.DF$spectra[, seq(1, ncol(NSpec.DF$spectra), 10)] # resampled to 10 nm steps
cm <- cm.nsr(S, x, cm.plot = TRUE)


Plotting correlation matrix

The correlation matrix plot is the plot of correlation coefficients (r/r2) by bands in x- and y-axis.

# use the output from last example
# cm <- cm.nsr(S, x)
# Plotting the correlation matrix
ggplot.cm(cm)


More Examples and Details

The computation of SR and NSR follow the equations, e.g.:

$SR = \lambda_i / \lambda_j$

$NSR = (\lambda_i - \lambda_j)/(\lambda_i + \lambda_j)$

To know more about the NDVI, please also check on Wikipedia^[Normalized difference vegetation index (https://en.wikipedia.org/wiki/Normalized_difference_vegetation_index)].

Example data NSpec.DB

The first type is the 'NSpec.DB' in the default S4 class 'Spectra'.

library(visa)
# check the data type
class(NSpec.DB)
# data structure
# str(NSpec.DB)
# print the first 10 columns


Example data NSpec.DF

The second type is a data.frame format, i.e., NSpec.DF.

# check the data type
class(NSpec.DF)
# check whether it contains the same data as 'NSpec.DB'


Accessing data

spectra

wavelength

Compatibility

Data format conversion

as.spectra

as.spectra.data.frame

Future development

Regarding compatibility for future development, special focuses will be put on:

• spatial data integration
• image analysis
• deep learning

visa believes:

"Software probably makes knowledge gaps, but should not be due to the access to software."

Try the visa package in your browser

Any scripts or data that you put into this service are public.

visa documentation built on April 20, 2021, 9:07 a.m.