forked from jeffreyhanson/marxan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquickstart.Rmd
78 lines (56 loc) · 2.29 KB
/
quickstart.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
marxan quick start guide
============
First, let's load the 'marxan' R package and some example data.
```{r, eval=FALSE}
# load marxan R package
library(marxan)
# load example data
data(taspu, tasinvis)
```
This data comes from the ['Introduction to Marxan'](http://marxan.net/courses.html). The `taspu` object stores data for the planning units, and the `tasinvis` object stores data for 63 vegetation classes--the biodiversity features in this example problem. Let's make some reserve systems and plot them.
```{r, eval=FALSE}
# make reserve systems
results<-marxan(taspu, tasinvis, targets="20%", NUMREPS=100L, BLM=0)
# geoplot for best solution
plot(results, 0)
# geoplot for selection frequencies
plot(results)
```
We can also plot distribution of features in the planning units.
```{r, eval=FALSE}
# plot distribution of vegetation class 5
spplot(results, 5, var='occ')
# plot richness in planning units
spplot(results, var='occ')
```
The solutions in this portfolio are fairly fragmented. Let's generate some more solutions with a higher boundary length modifier (BLM).
```{r, eval=FALSE}
# generate new portfolio of reserve systems
results2<-update(results, ~opt(BLM=500))
```
Now, let's compare solutions in the two portfolios.
```{r, eval=FALSE}
# geoplot comparing best solutions in each portfolio
plot(results, results2, i=0, j=0)
# geoplot comparing selection frequencies
plot(results, results2, basemap='satelliet', alpha=0.4)
```
The solutions in the second portfolio seem to be better. How can we rank the solutions within this portfolio? Let's make some dotcharts.
```{r, eval=FALSE}
# dotchart ranking solutions based on overall score
dotchart(results2, var='score')
# dotchart ranking solutions based on connectivity
dotchart(results2, var='con')
```
Finally, let's use multivariate analyses to visualise and compare the solutions in the second portfolio.
```{r, eval=FALSE}
# dendrogram showing how similar solutions are to each other based on selections
dendrogram(results2, type='dist', var='selections', nbest=10)
# ordination plot show how similar solutions are to each other based on
# well they represent different features
ordiplot(results2, type='mds', var='amountheld', method='bray')
```
<!--
%\VignetteEngine{knitr::knitr}
%\VignetteIndexEntry{Quick start guide to the marxan R package}
-->