Learn R Programming

⚠️There's a newer version (1.0.1) of this package.Take me there.

raptr

Biodiversity is in crisis. The overarching aim of conservation is to preserve biodiversity patterns and processes. To this end, protected areas are established to buffer species and preserve biodiversity processes. But resources are limited and so protected areas must be cost-effective. This package contains tools to generate plans for protected areas (prioritizations), using spatially explicit targets for biodiversity patterns and processes. To obtain solutions in a feasible amount of time, this package uses the commercial 'Gurobi' software package (obtained from http://www.gurobi.com/). Additionally, the 'rgurobi' package can also be installed to provide extra functionality (obtained from http://github.com/jeffreyhanson/rgurobi).

This package depends on several packages which can be difficult to install under Linux and Mac operating systems.

Linux users can install them typing the following code into the terminal:

sudo apt-get update
sudo apt-get install libgdal-dev
sudo apt-get install libproj-dev
sudo apt-get build-dep r-cran-rgl

Mac users can install them using this code in the terminal:

brew install Caskroom/cask/xquartz
brew install gdal
Rscript -e "setRepositories(ind=1:2);install.packages(c('rgdal','rgeos'))"

To install the latest official version from CRAN, use the following R code:

install.packages('raptr')

To install the development version from GitHub, use this R code:

if (!require('devtools'))
	install.packages('devtools', repo='http://cran.rstudio.com', dep=TRUE)
devtools:::install_github('jeffreyhanson/raptr')

Once this package has been installed, you can read through the vignette for a tutorial on how to use it.

View it here, or by running this R code:

# open vignette in web browser
vignette('raptr', package='raptr')

If this R package helped you, please cite it.

Hanson J. O., Rhodes J. R., Possingham H. P, and Fuller R. A. (2016). raptr: Representative and Adequate Prioritization Toolkit in R. R package. R package version 0.0.3. https://github.com/jeffreyhanson/raptr.

Copy Link

Version

Install

install.packages('raptr')

Monthly Downloads

705

Version

0.0.3

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Jeffrey O Hanson

Last Published

November 25th, 2016

Functions in raptr (0.0.3)

blank.raster

Blank raster
AttributeSpaces

Create new AttributeSpaces object
cache

Get and set cache Methods
as.list

Convert object to list.
calcSpeciesAverageInPus

Calculate average value for species data in planning units
AttributeSpace

Create new AttributeSpace object
calcBoundaryData

Calculate boundary data for planning units
amount.target

Amount targets
GurobiOpts

Create GurobiOpts object
casestudy_data

Case-study dataset for a conservation planning exercise
is.GurobiInstalled

Test if Gurobi is installed on computer
dp.subset

Subset demand points
is.gdalInstalled

Test if GDAL is installed on computer
is.comparable

Compare Rap objects
is.cached

Test if hash is cached in a Rap object
logging.file

Log file
DemandPoints

Create new DemandPoints object
make.DemandPoints

Generate demand points for RAP
PlanningUnitPoints

Create new PlanningUnitPoints object
maximum.targets

Maximum targets
print

Print objects
plot

Plot object
names

Names
PolySet-class

PolySet
make.RapData

Make data for RAP using minimal inputs
pu.subset

Subset planning units
prob.subset

Subset probabilities above a threshold
ManualOpts

Create ManualOpts object
RapSolved

Create new RapSolved object
RapUnreliableOpts

Create RapUnreliableOpts object
RapResults

Create RapResults object
rap

Generate prioritisations using RAP
randomPoints

Sample random points from a RasterLayer
RapReliableOpts

Create RapReliableOpts object
raptr

raptr: Representative and Adequate Prioritisation Toolkit in R
RapUnsolved

Create a new RapUnsolved object
RapData

Create new RapData object
RapOpts-class

RapOpts class
sim.pus

Simulate planning units
sim.space

Simulate attribute space data for RAP
rasterizeGDAL

Rasterize polygon data using GDAL
read.RapResults

Read RAP results
rrap.proportion.held

Proportion held using reliable RAP formulation.
sim.species

Simulate species distribution data for RAP
score

Solution score
show

Show objects
simulated_data

Simulated dataset for a conservation planning exercise
spp.plot

Plot species
selections

Extract solution selections
spp.subset

Subset species
summary

Summary of solutions
solve

Solve RAP object
update

Update object
space.target

Attribute space targets
SolverOpts-class

SolverOpts class
urap.proportion.held

Proportion held using unreliable RAP formulation.
space.held

Extract attribute space held for a solution
SpatialPolygons2PolySet

Convert SpatialPolygons to PolySet data
space.plot

Plot space
amount.held

Extract amount held for a solution
basemap

Basemap
AttributeSpace-class

AttributeSpace: An S4 class to represent an attribute space.
DemandPoints-class

DemandPoints: An S4 class to represent demand points
ManualOpts-class

ManualOpts: An S4 class to represent parameters for manually specified solutions
GurobiOpts-class

GurobiOpts: An S4 class to represent Gurobi parameters
AttributeSpaces-class

AttributeSpaces: An S4 class to represent a collection of attribute spaces for different species.
RapData-class

RapData: An S4 class to represent RAP input data
RapUnsolved-class

RapUnsolved: An S4 class to represent RAP inputs
PlanningUnitPoints-class

PlanningUnitPoints: An S4 class to represent planning units in an attribute space
RapUnreliableOpts-class

RapUnreliableOpts: An S4 class to represent parameters for the unreliable RAP problem
RapReliableOpts-class

RapReliableOpts: An S4 class to represent input parameters for the reliable formulation of RAP.
RapSolved-class

RapSolved: An S4 class to represent RAP inputs and outputs
RapResults-class

RapResults: An S4 class to represent RAP results