removeSitesFromSitePair: Remove Random Sites from Site-Pair Table

Description Usage Arguments Value Note See Also Examples

View source: R/GDM_Table_Funcs.R

Description

Randomly selects a number of sites from a given site-pair table and removes them from the site-pair table. It will remove all instances of the sites randomly selected to be removed in both s1 and s2 positions.

Usage

1
removeSitesFromSitePair(spTable, sampleSites)

Arguments

spTable

A site-pair table, same as used to fit a gdm.

sampleSites

The fraction (0-1, though a value of 0 would be silly, wouldn't it?) of sites to retain from the full site-pair table. If less than 1, this argument will completely remove a fraction of sites such that they are not used in the permutation routines.

Value

A site-pair table, such as one created by formatsitepair, ideally smaller than the one given. In the very rare case where the function determines not to remove any sites, or should the sampleSites argument be 1, then the function will return the full site-pair table.

Note

This function removes sites, not just site-pairs (rows) from the site-pair table. This function is called from several of the other functions within the gdm package, including the plotUncertainty and gdm.varImp functions, for the purposes of subsampling the sites in the site-pair table.

See Also

formatsitepair

Examples

1
2
3
4
5
6
7
8
9
##fit table environmental data
##sets up site-pair table, environmental tabular data
load(system.file("./data/gdm.RData", package="gdm"))
sppData <- gdmExpData[c(1,2,13,14)]
envTab <- gdmExpData[c(2:ncol(gdmExpData))]
sitePairTab <- formatsitepair(sppData, 2, XColumn="Long", YColumn="Lat", sppColumn="species", 
	siteColumn="site", predData=envTab)

removeSitesFromSitePair(sitePairTab, sampleSites=0.7)

gdm documentation built on Sept. 16, 2017, 1:02 a.m.