-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME.Rmd
135 lines (96 loc) · 4.68 KB
/
README.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
---
output:
md_document:
variant: markdown_github
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```
[![img](https://img.shields.io/badge/Lifecycle-Maturing-007EC6)](https://github.com/bcgov/repomountie/blob/master/doc/lifecycle-badges.md)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
```{r, echo=FALSE, results='asis', message=FALSE}
library("envreportutils")
```
# Analysis of trends and current amounts of protected lands and waters in B.C.
A set of R scripts to complete the analysis behind the Environmental Indicator [Protected Lands & Waters in B.C.](http://www.env.gov.bc.ca/soe/indicators/land/protected-lands-and-waters.html), published by [Environmental Reporting BC](http://www2.gov.bc.ca/gov/content?id=FF80E0B985F245CEA62808414D78C41B) in June 2016.
**Note**: Moving forward this analysis and indicator will be updated using the analysis and approach found [here](https://github.com/bcgov/land-designations-indicator).
## Usage
### Data
The analysis uses data from several sources; they should be downloaded and stored in the `data` folder:
- [Canadian Council on Ecological Areas (CCEA) shapefile database of
protected areas in Canada](http://www.ccea.org/download-carts-data/)
- [B.C. Government Conservation
Lands](https://catalogue.data.gov.bc.ca/dataset/68327529-c0d5-4fcb-b84e-f8d98a7f8612) (Licence: `r get_data_license("ogl-bc")`)
- [B.C. NGO Conservation Areas Database — Fee Simple
Areas](http://ltabc.ca/resources/2012-02-05-22-20-02)
- [Ecoregions - Ecoregion Ecosystem Classification of British
Columbia](https://catalogue.data.gov.bc.ca/dataset/d00389e0-66da-4895-bd56-39a0dd64aa78) (Licence: `r get_data_license("ogl-bc")`)
- [Biogeoclimatic Ecosystem Classification (BEC)
Map](https://catalogue.data.gov.bc.ca/dataset/f358a53b-ffde-4830-a325-a5a03ff672c3) (Licence: `r get_data_license("ogl-bc")`)
### Code
There are four core scripts that are required for the analysis; they need to be run in order:
- `01_load.R` - unzips the data files in the data folder
- `02_clean.R` - cleans and prepares the spatial data for analysis, especially resolving overlaps among types of protected area designations
- `03_analysis.R` - performs the spatial intersections and creates data summaries
- `04_plot.R` - creates plots for communicating the results
The file `fun.R` contains a few custom functions required for the analysis.
#### Required R packages:
Spatial packages:
```
sp
rgdal
rgeos
raster
maptools
geojsonio
bcmaps
rmapshaper
```
General data manipulation packages:
```
dplyr
tidyr
readr
```
Plotting packages:
```
ggplot2
RColorBrewer
ggthemes
envreportutils
```
Most packages used in the analysis can be installed from CRAN using `install.packages()`, but there are a few you will need to install using devtools:
```r
install.packages("devtools") # If you don't already have it installed
library(devtools)
install_github("bcgov/envreportutils")
install_github("bcgov/bcmaps")
```
#### Other required software
You will also need the [mapshaper](https://github.com/mbloch/mapshaper) node package, and for this you will require Node.js to be installed.
You can install it from [here](https://nodejs.org/en/), then on the command line type:
```
npm install -g mapshaper
```
## Getting Help or Reporting an Issue
To report bugs/issues/feature requests, please file an [issue](https://github.com/bcgov/bc_population_indicator/issues/).
## How to Contribute
If you would like to contribute, please see our [CONTRIBUTING](CONTRIBUTING.md) guidelines.
Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
## License
Copyright 2016 Province of British Columbia
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
This repository is maintained by [Environmental Reporting BC](http://www2.gov.bc.ca/gov/content?id=FF80E0B985F245CEA62808414D78C41B). Click [here](https://github.com/bcgov/EnvReportBC) for a complete list of our repositories on GitHub.