eco.detrend: Detrending spatial data with polynomial interpolation

Description Usage Arguments Value Author(s) References Examples

Description

This program performs a Trend Surface Analysis (Borcard et al. 2011, Legendre and Legendre 2012, Lichstein et al 2002) for the data Z and the given coordinates, projected or in decimal degrees format, in which case will be projected with geoXY.

Usage

1
2
3
4
5
6
7
8
9
eco.detrend(
  Z,
  XY,
  degree,
  center = TRUE,
  scale = FALSE,
  raw = FALSE,
  latlon = FALSE
)

Arguments

Z

Data frame, matrix or vector with dependent variables.

XY

Data frame, matrix or vector with projected coordinates (X, XY or XYZ). For longitude-latitude data in decimal degrees format, use the option latlon = TRUE.

degree

Polynomial degree.

center

Should the data be centered? Default TRUE

scale

Should the data be scaled? Default FALSE

raw

Use raw and not orthogonal polynomials? Default FALSE

latlon

Are the coordinates in decimal degrees format? Defalut FALSE. If TRUE, the coordinates must be in a data.frame/matrix with the longitude in the first column and latitude in the second. The position is projected onto a plane in meters with the function geoXY.

Value

An object of class "eco.detrend" with the following slots:

> POLY.DEG polynomial degree used in the analysis

> RES detrended data

> XY projected coordinates

> MODEL models selected with the Akaike criterion

> ANALYSIS object of class "eco.mlm" with the regression results for each variable

ACCESS TO THE SLOTS The content of the slots can be accessed with the corresponding accessors, using the generic notation of EcoGenetics (<ecoslot.> + <name of the slot> + <name of the object>). See help("EcoGenetics accessors") and the Examples section below.

Author(s)

Leandro Roser learoser@gmail.com

References

Borcard D., F. Gillet, and P. Legendre. 2011. Numerical ecology with R. Springer Science & Business Media.

Legendre P., and L. Legendre. 2012. Numerical ecology. Third English edition. Elsevier Science, Amsterdam, Netherlands.

Lichstein J., T. Simons, S. Shriner, and K. Franzreb. 2002. Spatial autocorrelation and autoregressive models in ecology. Ecological monographs, 72: 445-463.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
## Not run: 

data(eco2)

# original data
data1 <- matrix(eco2[["P"]][,1], 30, 30)
image(data1)

# original data + trend
data2 <- matrix(eco2[["P"]][,2], 30, 30)
image(data2)

# data detrending
data2.det <- eco.detrend(Z = eco2[["P"]][,2], XY =  eco2[["XY"]], degree =  1)


#-----------------------
# ACCESSORS USE EXAMPLE
#-----------------------

# the slots are accesed with the generic format 
# (ecoslot. + name of the slot + name of the object). 
# See help("EcoGenetics accessors")

data2.det <- ecoslot.RES(data2.det)       # detrended data in slot RES

data2.det <- matrix(data2.det[,1], 30, 30)
image(data2.det)



## End(Not run)

EcoGenetics documentation built on July 8, 2020, 5:46 p.m.