National Park Service

Inventory & Monitoring (I&M)

R Packages for Natural Resources

Please direct questions and comments about these pages, and the R-project in general, to Dr. Tom Philippi.

There are over 2500 contributed packages available on CRAN, plus an unknown number of packages only available elsewhere, often r-forge, but also sometimes at USGS or EPA or other agencies: until recently the spsurvey package was only available from EPA, not CRAN. No one uses every package, or even knows what every one does. The list of packages currently on CRAN is at:

http://cran.r-project.org/web/packages/

Each package has a brief to cryptic description; clicking on the package name links to a page with a bit more information, including a pdf version of the package documentation, and possibly an additional user guide or vignette. [When you install a package, its documentation pages get automatically added to your local R help system.]


Task Views

CRAN has task views by fields or applications, including views for Environmetrics, Genetics, Spatial, Survival, and TimeSeries. Task views tend to group packages by topic within that field, and provide a bit more information, but they are not comprehensive. For instance, the Environmetrics task view didn't include any of the packages for mark-recapture analyses or radio-tracking until I sent Gavin (the maintainer of the task view) a list of annotated suggestions. Still, I find the task views useful as a first shot at finding a package for a particular problem. If I don't find what I need, my second attempt is to use my browser's find in page on the full package list page. The third option (perhaps better than the second) is to use the R site search page.

The other advantage of task views is that you can easily download and install all packages in that task view at once. The code to do that involves installing and loading library ctv:

install.packages("ctv")
library("ctv") install.views("Environmetrics")


Tom's List

I maintain an idiosyncratic list of packages that I use or might use in my job with NPS Inventory & Monitoring. You can download the file here. Save it as Install.R (without the extra .txt equired because our web server if configured to not serve .R files); open in a text editor


# Toms code to install packages after installing R
# Use a text editor to comment out (#) lines with packages you don't
# want to install, delete comment marks (#) from the install.packages()
# lines for packages you want to install, and then paste it into R.
# This code is most useful for installing R on a laptop that won't
# always have access to the internet, or for finding out some of the packages
# that might be related to your needs.  I suggest downloading the file, opening
# it into a text editor, then copying blocks you want to install and
# pasting them into the R Console.  
# Alternatively, you can download, then edit the file, commenting out
# blocks you don't need, then save the file and run it in R.

# Set mirror # You can modify this to point to a mirror more appropriate for you r <- getOption("repos" ) r["CRAN" ] <- "http://cran.stat.ucla.edu" options(repos=r) ############################################## # Paul's list of packages for Learn R 2009 install.packages(c("car","conf.design","corrgram","DAAG", "effects","ellipse","faraway","gplots", "lattice", "leaps","nlme","lmtest","MASS","Rcmdr", "RcmdrPlugin.HH","RODBC","sciplot","tree")) ############################################## # Paul's list of packages for Learn R 2010 is HSAUR2 # plus Rcmdr & plugins in the next block install.packages("HSAUR2",dep=TRUE) ############################################## # The full set of plugins for the Rcmdr GUI (at one time, check for new plugins) install.packages(c("Rcmdr","RcmdrPlugin.DOE","RcmdrPlugin.Export", "RcmdrPlugin.FactoMineR","RcmdrPlugin.HH", "RcmdrPlugin.IPSUR","RcmdrPlugin.MAc","RcmdrPlugin.MAd","RcmdrPlugin.PT", "RcmdrPlugin.SLC","RcmdrPlugin.SensoMineR","RcmdrPlugin.SurvivalT", "RcmdrPlugin.TeachingDemos","RcmdrPlugin.TextMining","RcmdrPlugin.doex", "RcmdrPlugin.epack","RcmdrPlugin.orloca","RcmdrPlugin.qcc", "RcmdrPlugin.qual","RcmdrPlugin.sos","RcmdrPlugin.steepness", "RcmdrPlugin.survival",dep=TRUE) install.packages("BiodiversityR",dep=TRUE) ############################################## # Advanced data i/o # I strongly recommend foreign and RODBC install.packages(c("RODBC","foreign"),dep=TRUE) # If you will use various GIS/RS files, you should install GDAL # from http://www.dgal.org, then this package: install.packages("rgdal",dep=TRUE) # These are some of the other data i/o packages I use install.packages(c("ncdf","xml","R2HTML","RMySQL", "shapefiles","RArcInfo"),dep=TRUE) ############################################## # data manipulation install.packages(c("reshape","plyr","gdata","vcdExtra","sqldf"),dep=TRUE) ############################################## # Uncategorized packages I install (many in environmetrics and Paul's set) install.packages(c("car","conf.design","corrgram","DAAG","date", "effects","ellipse", "faraway","sem","sp","sqldf","vcd", "leaps","nlme","lmtest","VR"),dep=TRUE) ############################################## # # package for SWord, DCOM, SpatialModellingEnvironment, etc. install.packages("rscproxy","R2wd",dep=TRUE) ############################################## # graphics install.packages(c("RColorBrewer","colorRamps","gplots","sciplot", "lattice","latticeExtra","latticedl","latticist","rggobi","ggplot2","gdata","meifly"),dep=TRUE) # Directlabels works for both lattice and ggplot install.packages("directlabels",repos="http://r-forge.r-project.org") ############################################## # This block installs all of the packages in the Environmetrics # task view. # see http://cran.r-project.org/web/views/Environmetrics.html #includes "labdsv","fso","vegan", but not "gcl" # Task views are also available for spatial statistics & other topics install.packages("ctv") library("ctv") install.views("Environmetrics") # Packages too new to be in Environmetrics install.packages(c("caret","statDA","emdbook"),dep=TRUE) # Get most recent build of vegan install.packages("vegan",repos="http://r-forge.r-project.org",dep=TRUE) # get gravy (intended to "put some meat in vegan") install.packages("gravy", repos="http://r-forge.r-project.org") ############################################## ##### Spatial Stuff # tesselations (Veroni, triangles, etc.) install.packages(c("tripack","deldir","geometry"),dep=TRUE) # Spatial interpolation install.packages(c("AIGIS","gstat"),dep=TRUE) # Point patterns install.packages(c("ads","spatialkernel","spatialsegregation","spatstat", "spdep","spgwr","ecespa","fields"),dep=TRUE) # mapping data & tools install.packages(c("maps","gmaps","geomapdata", "geonames","maptools"),dep=TRUE) # GIS-like tools install.packages(c("RPyGeo","RSAGA","PBSmapping","GeoXp", "GeoR","GeoRglm","gpclib"),dep=TRUE) # Raster (grid) imagery; ~ERDAS/Imagine install.packages("raster",dep=TRUE) # If you will use various raster & grid files, you should install GDAL # from http://www.dgal.org, then this package: install.packages("rgdal",dep=TRUE) # distance-decay install.packages("betaper",dep=TRUE) ############################################## # Nestedness and clustering of species*site matrices install.packages("bipartite","prabclus") #vegan does nestedness too # methods to analyze distance matrices install.packages("gdistanalyst", repos="http://R-Forge.R-project.org",dep=TRUE) # calculate graph-based distances from raster data install.packages("gdistance", repos="http://R-Forge.R-project.org",dep=TRUE) # generalized regression and spatial prediction install.packages("grasp",dep=TRUE) # no longer on cran # space-time ecological series install.packages("pastecs",dep=TRUE) # More general spatio-temporal analysis & modelling install.packages("stam",dep=TRUE) ############################################## # biodiversity & niche modeling install.packages("diversity", repos="http://R-Forge.R-project.org",dep=TRUE) install.packages("BIOMOD", repos="http://R-Forge.R-project.org",dep=TRUE) ############################################## # habitat prediction (also adehabitat VGAM, etc. in environmetics task view) install.packages("ModelMap",dep=TRUE) install.packages("BIOMOD", repos="http://R-Forge.R-project.org",dep=TRUE) install.packages("PresenceAbsence",dep=TRUE) ############### # Stable Isotopes install.packages("siar","sisus",dep=TRUE) ################################################### ##### Wildlife stuff # Mark-Recapture & radio-tracking install.packages(c("mra","Rcapture","trip","tripEstimation"),dep=TRUE) # Spatially explicit Mark-Recapture install.packages(c("secr","SPACECAP"),dep=TRUE) # distance sampling, occupancy estimation, eventual replacement for DISTANCE and PRESENCE install.packages("unmarked",dep=TRUE) # matrix demographic models install.packages("popbio",dep=TRUE) #install.packages("demogR",dep=TRUE) # no longer on CRAN #calibration inferred environments install.packages(c("bio.infer","fossil","paltran","analogue"),dep=TRUE) # fisheries tools such as catch per unit effort, I believe growth curves install.packages("fishmethods",dep=TRUE) ############################################## # Species association analyses also vegan and labDSV install.packages("spaa",dep=TRUE) install.packages("mefa",dep=TRUE) # sympatry among species ranges install.packages(c("compositions","picante", "synet"),dep=TRUE) ############################################## ######## Survey design & analysis (spsurvey does GRTS) install.packages(c("ars","survey","spsurvey","RSurvey","memisc"),dep=TRUE) #analysis of panel designs install.packages(c("pcse","plm"),dep=TRUE) # Isotonic regression for trends install.packages("Iso",dep=TRUE) ############################################## # data envelopment & extreme values install.packages(c("DEA","evd","evdbayes","evir","extRemes","ismev"),dep=TRUE) # see http://www.ral.ucar.edu/~ericg/softextreme.php ############################################## #Zero-inflated models (other packages available) install.packages(c("ZIGP","COZIGAM","zicounts",),dep=TRUE) ############################################## # Bayesian geostatistical modeling install.packages("ramps",dep=TRUE) install.packages("MCMCglmm",dep=TRUE) ############################################## # growth curves install.packages("growfit",dep=TRUE) ##install.packages("agce",dep=TRUE) #may be abandoned # Toxicology dose-response curves install.packages("drc",dep=TRUE) ############################################## #climate data install.packages(c("anm","clim.pact","climatol","seas","zyp"),dep=TRUE) ############################################## # Phenology data install.packages(c("bise","pheno"),dep=TRUE) ############################################## # Water Quality, hydrology, toxicology install.packages("hydrogeo",dep=TRUE) # (groundwater install.packages("hydrosanity",dep=TRUE) # hydrologic time series install.packages("wq",dep=TRUE) # water quality install.packages("Rhydro",dep=TRUE) # (R-forge) install.packages("HydroMe",dep=TRUE) # soil hydrolic parameters install.packages("topmodel",dep=TRUE) # install.packages("wasim",dep=TRUE) # ############################################## # circular statistics (Included in Environmetrics) install.packages(c("deldir", "CircStats", "gplots","ks","circular"), dep=TRUE) ############################################## # tree-based methods install.packages(c("tree","rpart","mvpart","party","randomForest", "ipred","maptree","pinktoe","lago","gbev","gcl", "knnTree","marginTree","oblique.tree","psychotree", "REEMtree","rpartOrdinal","treelet","treethresh","TWIX", "BayesTree",),dep=TRUE)

⇑ To Top of Page

Last Updated: December 30, 2016 Contact Webmaster