sr: Calculate Simple Ratio (SR).

Description Usage Arguments Details Value Examples

View source: R/sr.R

Description

Simple Ratio is the ratio of the spectra (mostly reflectance) between two bands in the format of

SR = λ_i/λ_j

It is a normalization of SR by doing NSR = (1-SR)/(1+SR), with the same two spectral bands.

Usage

1
2
3
4
5
6
7
sr(s, b1, b2)

nsr(s, b1, b2)

lm.sr(s, b1, b2, y)

lm.nsr(s, b1, b2, y)

Arguments

s

Spectral data in the format of visa's Spectra object, spectra.data.frame or spectra.matrix.

b1

A integer number which defines the wavelength of the 1st spectral band.

b2

A integer number which defines the wavelength of the 2nd spectral band.

y

A numeric variable to correlate with SR

Details

Simple ratio and NDVI looking indices are the two groups of mostly used spectral indices in remote sensing.

As it exactly reads in its name, it is a normalization of the SR and ranges in (0,1).

Value

sr

Returns a simple ratio index.

nsr

Returns a NSR index.

p

Returns a ggplot object.

p

Returns a ggplot object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
library(visa)
s <- NSpec.DF$spectra
sr1 <- sr(s, 480, 550)

s <- NSpec.DF$spectra
nsr1 <- nsr(s, 480, 550)

s <- NSpec.DF
y <- NSpec.DF$N
lm.sr(s,600,500,y)

s <- NSpec.DF
y <- NSpec.DF$N
lm.nsr(s,600,500,y)

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