An R package with ggplot2 themes and other functions commonly used by the Environmental Reporting BC team when developing environmental reporting indicators and related products.
Plotting-related functions:
theme_soe()
- defaultggplot2
theme for Environmental Reporting BC graphstheme_soe_facet()
- defaultggplot2
theme for Environmental Reporting BC graphs using facettingbgc_colours()
- get colour codes for B.C. Biogeoclimatic (BGC) Zonessvg_px()
&save_svg_px()
- create and save svg for the web, specifying size in pixelspng_retina()
&save_png_retina()
- create and save png for retina display
Data wrangling & sharing functions:
report_percent()
- perform standardized rounding of percentage values for reportingto_titlecase()
- simple helper function to convert"AnY stRanGELy forMaTTed STring"
to"Title Case"
get_data_licence()
- get the url, or a markdown or html-formatted link to one of several B.C. or Canadian licencessoft()
- use ENV SOFT utility from within Rsoe_path()
&set_soe_root()
- set path to a folder or file in the ENV State of Evnvironment program network drive
Leaflet-related functions:
add_bc_home_button()
- add a ‘Zoom to B.C. button’ to a leaflet mapset_bc_view()
- set leaflet map view to B.C.set_bc_view_on_close()
- re-centre map to B.C. on popup closepopup_create_row()
- create a popup row div for leaflet mapspopup_combine_rows()
- combine popup rows for leaflet mapscss_caaqs_copy()
- create copy of CAAQS CSS styles for leaflet mappopup_caaqs()
- create popup for CAAQS indicators
Deprecated functions:
order_df()
- order a data frame using summary of a specified column or specify the order manually (this function is deprecated, seeforcats::fct_reorder
for the same functionality)multiplot()
- combine multipleggplot2
plots into one (this function is deprecated, see thecowplot
or patchwork packages for the same functionality)
The package also installs an RStudio Addin for adding a custom footer to READMEs for projects maintained by Environmental Reporting BC.
You can install the package directly from this repository. To do so, you will need the devtools package:
install.packages("devtools")
Next, install the envreportutils
package using
devtools::install_github()
:
library("devtools")
install_github("bcgov/envreportutils")
This package is under continual development.
To report bugs/issues/feature requests, please file an issue.
If you would like to contribute to the package, please see our CONTRIBUTING guidelines.
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
Copyright 2015 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. Click here for a complete list of our repositories on GitHub.