Learn R Programming

hsdar (version 0.5.1)

cor.test: Test for association/correlation between nri values and vector of samples

Description

Test for association between paired samples (with one variable being nri-values), using one of Pearson's product moment correlation coefficient, Kendall's tau or Spearman's rho.

Usage

"cor.test"(x, y, ...)

Arguments

x
Object of class Nri or numerical vector
y
Object of class Nri or numerical vector
...
Further arguments passed to cor.test

Value

Object of class Nri

Details

NRI-values may be used as x and/or as y variable. If x and y are NRI-values the number of samples in both datasets must be equal. For additional information on correlation tests see details in cor.test.

See Also

plot, cor.test, glm.nri, lm.nri, getNRI

Examples

Run this code
data(spectral_data)

## Calculate all possible combinations for WorldView-2-8
spec_WV <- spectralResampling(spectral_data, "WorldView2-8",
                              response_function = FALSE)
nri_WV <- nri(spec_WV, recursive = TRUE)

cortestnri <- cor.test(nri_WV, attribute(spec_WV)$chlorophyll)

cortestnri

Run the code above in your browser using DataLab