Skip to content
An R package with ggplot2 themes & other functions related to Environmental Reporting BC work flows
R CSS
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
R
data-raw
inst
man
tests
.Rbuildignore
.gitignore
.travis.yml
CODE_OF_CONDUCT.md
CONTRIBUTING.md
DESCRIPTION
LICENSE
NAMESPACE
NEWS.md
README.Rmd
README.md
envreportutils.Rproj

README.md

envreportutils 0.9.0

In production, but maybe in Alpha or Beta. Intended to persist and be supported.Travis-CI Build StatusLicense

Overview

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.

Features

Plotting-related functions:

  • theme_soe() - default ggplot2 theme for Environmental Reporting BC graphs
  • theme_soe_facet() - default ggplot2 theme for Environmental Reporting BC graphs using facetting
  • bgc_colours() - get colour codes for B.C. Biogeoclimatic (BGC) Zones
  • svg_px() & save_svg_px()- create and save svg for the web, specifying size in pixels
  • png_retina() & save_png_retina() - create and save png for retina display

Data wrangling & sharing functions:

  • report_percent() - perform standardized rounding of percentage values for reporting
  • to_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 licences
  • soft() - use ENV SOFT utility from within R
  • soe_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 map
  • set_bc_view() - set leaflet map view to B.C.
  • set_bc_view_on_close()- re-centre map to B.C. on popup close
  • popup_create_row() - create a popup row div for leaflet maps
  • popup_combine_rows() - combine popup rows for leaflet maps
  • css_caaqs_copy() - create copy of CAAQS CSS styles for leaflet map
  • popup_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, see forcats::fct_reorder for the same functionality)
  • multiplot() - combine multiple ggplot2 plots into one (this function is deprecated, see the cowplot 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.

Installation

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")

Project Status

This package is under continual development.

Getting Help or Reporting an Issue

To report bugs/issues/feature requests, please file an issue.

How to Contribute

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.

License

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.

You can’t perform that action at this time.