-
Notifications
You must be signed in to change notification settings - Fork 4
User Guide
Marlon E. Cobos, Hannah L. Owens, and A. Townsend Peterson
Some of the main functions of nichevol use data that need to be loaded from a local directory and others produce results that need to be written in a local directory. Loading data from a local directory and writing the results outside the R environment helps to avoid problems related to RAM limitations. The figure below shows how the directory needs to be structured when working on a project considering multiple variables and species.
Figure 1. Suggested structure of data in a working directory for starting analyses, when more than one environmental variable needs to be considered.
The code below helps to set a working directory before starting analyses:
directory <- "DRIVE:/YOUR/DIRECTORY" # change the characters accordingly
setwd(directory)
The stable version of nichevol is in CRAN and it can be installed using the code below:
install.packages("nichevol")
The most recent version of nichevol is available at a GitHub repository and can be installed using the code below. Please, have in mind that updates will be done on this version continuously, which may introduce problems and instabilities.
Note: Try the code below first… If you have any problem during the installation, restart your R session, close other sessions you may have open, and try again. If during the installation you are asked to update packages, please do it. If any of the packages gives an error, please install it alone using install.packages()
, then try re-installing nichevol again. Also, it may be a good idea to update R and RStudio (if you are using it).
# Installing and loading packages
if (!require(devtools)) {
install.packages("devtools")
}
if (!require(nichevol)) {
devtools::install_github("marlonecobos/nichevol")
}
Once nichevol is installed you can load the package with the following line.
library(nichevol)
Knowing how your data looks like is an important first step before running further analyses.
First, let's see some descriptive statistics of environmental values in the accessible areas and in the species occurrences.
# learn how to use the next function
help(stats_evals)
# now calculations
stats <- stats_evals()
Now, let's produce a graphical representation of how environmental values in the accessible areas and in the species occurrences.
# learn how to use the next function
help(hist_evalues)
# now calculations
stats <- hist_evalues()