fgeasy: Single step version of the Floating Grid Permutation...

Description Usage Arguments Value Author(s) References See Also Examples

Description

The Floating Grid Permutation Technique is a spatially restricted permutation technique. Please read the reference mentioned below and/or the vignette before using this function. fgeasy can be used to perform single step permutation tests. This function can be used for detecting spatial autocorrelation for univariate observations (using Moran's I), pairwise observations (using a correlation coefficient) or multivariate observations for both single and pairwise sets of multivariate observations (using mean distance or relatedness).

Usage

1
2
fgeasy(xy, group=1, marks, iter=999, ratio=1, scale.seq=seq(from=0, to=max(dist(xy)), 
  length.out=21)[2:21], bootstrap=FALSE, pairwise=FALSE, correlate=FALSE)

Arguments

xy

Geographical locations of observations.

group

Group membership for the observations. group is optional.

marks

Should be a vector containing all observations, a two-column matrix containing two paired observations or a squared matrix containing relationships or distances between all observations (such as genetic relatedness or distance). The latter can be used to perform multivariate analyses. Note that the squared matrix does not need to be symmetrical: for instance, the genetic relatedness between paired individuals can be investigated by using males as columns and females as rows. NAs are allowed.

iter

Number of iterations for every grid cell size. Default is 999, though it is adviseable to perform 9999 interations for the final results.

ratio

The ratio between the sides of the grid cells. Default is 1.

scale.seq

Sequence of all grid cell sizes that will be tested. The number, order and values of this sequence are completely free, as long as they are numeric. Default is 20 equaly spaced out grid cell sizes from slightly larger than 0 to the maximum distance between any two individuals.

bootstrap

TRUE if observations should to be drawn with replacement, FALSE if not. Default is FALSE.

pairwise

TRUE if observations consist of two paired marks per observation, FALSE if not. Default is FALSE. If pairwise==FALSE Moran's I is used as test statistic.

correlate

If one wants to compare two paired observations correlations between the observations can be used. The argument correlate can be used to pass on the peferred method of correlation as available in cor.test; so "pearson", "kendall" or "spearman". If marks is not a two-column matrix correlate should be FALSE. Default is FALSE.

Value

fgeasy returns an object of class "fg", which can be accessed with the functions summary and plot.

Author(s)

Reinder Radersma

References

Reinder Radersma & Ben C. Sheldon, 2015. A new permutation technique to explore and control for spatial autocorrelation. Submitted

See Also

cor.test

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
## A simple univariate example
##
## Produce 49 geographical locations in a regular grid.
loc.x <- rep(1:7,7)
loc.y <- rep(1:7, each=7)

## Produce 49 observations with negative spatial autocorrelation.
marks <- c(rep(c(1,2), 24),1)+rnorm(49,0,0.1)

fg1 <- fgeasy(xy=cbind(loc.x,loc.y), marks=marks, iter=99)
summary(fg1)
plot(fg1)

## An example for two paired marks
##
## Produce 20 geographical locations.
loc.x <- 1:20
loc.y <- runif(20,0,5)

## Produce 2 x 20 phenotypes.
type1 <- 11:30+runif(20,0,5)
type2 <- 11:30+runif(20,0,5)

fg2 <- fgeasy(xy=cbind(loc.x,loc.y), marks=cbind(type1,type2), iter=99, 
        pairwise=TRUE, correlate="pearson")
summary(fg2)
plot(fg2)
  

fgpt documentation built on May 1, 2019, 9:45 p.m.