plot.RNE | R Documentation |
Calculates effect of deleting sites from training set at random, from a geographic neighbourhood, or from an environmental neighbourhood. A simple graphical technique for gauging the effect of spatial autocorrelation on the transfer function model.
## S3 method for class 'RNE' plot(x, which = 1, ylim, ...) rne( y, env, geodist, fun, neighbours, subsets = c(1, 0.75, 0.5, 0.25, 0.1), ... )
x |
RNE object to be plotted |
which |
Which column of the results to plot eg if more than one WAPLS component is calculated |
ylim |
Y-limits of the plot |
... |
Arguments passed to fun |
y |
Community data, or distance object, or distance matrix |
env |
Environmental variable |
geodist |
Matrix of geographical distances between sites |
fun |
Transfer function |
neighbours |
Neighbourhood radii |
subsets |
Proportion of sites to retain in random deletion |
Finds the leave-one-out transfer function performance if sites are deleted at random, from a neighbourhood zone, or by deleting environmentally close sites.
Prior to version 2.1, this function would repeat the random removal 10 times to reduce variance in results. This is no longer done as the variance is small for large training sets, it took a long time, and treats one treatment of the data differently.
Returns an RNE object, list with two components
random Performance with random deletion.
neighbour Performance with deletion by neighbourhood, or environment
plot(RNE)
: Plot RNE object
Richard Telford Richard.Telford@bio.uib.no
Telford, R. J. and Birks, H. J. B. (2009) Evaluation of transfer functions in spatially structured environments. Quaternary Science Reviews 28: 1309–1316. doi: 10.1016/j.quascirev.2008.12.020
require(rioja) require(sf) data(arctic.env) data(arctic.pollen) # using just the first 100 sites so that code runs quickly (about 15 seconds for all 828 sites) # convert environmental data into an sf object arctic.env <- st_as_sf( x = arctic.env, coords = c("Longitude", "Latitude"), crs = 4326 ) # find great circle distances and remove units arctic.dist <- st_distance(arctic.env[1:100, ]) |> units::set_units("km") |> units::set_units(NULL) # rne arctic.rne <- rne( y = arctic.pollen[1:100, ], env = arctic.env$tjul[1:100], geodist = arctic.dist, fun = MAT, neighbours = c(0, 200), subsets = c(1, .5), k = 5 ) plot(arctic.rne)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.