View source: R/createPcaToCompare.R
createPcaToCompare | R Documentation |
This function uses ecospat to create PCA across Environments to compare niches. Requires some custom ecospat functions which are given below.
createPcaToCompare(loc_thin_bgstuff, perspecies_bgstuff, species, verbose = T)
loc_thin_bgstuff |
Background points for all species. |
perspecies_bgstuff |
Background points for each species. |
species |
Species name, for plotting |
loc_good_clean = cleanByEnvironment(Env, loc)
locs_thinned = spThinBySubspecies(loc_good_clean,thin.par=10,reps=1,lat.col="latitude",long.col="longitude",spec.col="assigned")
loc_thin_bgstuff = generateBackgroundForPCA(localities=loc_good[,c("Longitude","Latitude")],r=200000,num=(100*nrow(localities)),e=Env)
perspecies_bgstuff = generateBackgroundPerSpecies(loc_thin)
pcaOutput = createPcaToCompare(loc_thin_bgstuff,perspecies_bgstuffspecies)
pca_grid_clim = pcaOutput$grid_clim
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.