Learn R Programming

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

simplevis

Purpose

simplevis is a package of wrapper functions to make ggplot2 and leaflet visualisation easier.

The aim is of simplevis is to make the majority of visualisations easier, while supporting users to move between ggplot2 and simplevis as needed.

simplevis makes things easier by:

  • minimising visualisation types available to vbar, hbar, point, line, boxplot or sf
  • minimising aesthetics available to x, y, colour and facetting
  • using a simpler method for colouring
  • using consistent prefixes and the Rstudio auto-complete function
  • using ggplot2 based terminology for leaflet visualisation.

The package also supports making mobile-friendly visualisation for mobile devices.

Installation

Install stable version from CRAN: install.packages("simplevis")

Install development version from github: devtools::install_github("statisticsNZ/simplevis")

Documentation

Webpage URL:

https://statisticsnz.github.io/simplevis/

R vignette:

vignette("simplevis", "simplevis")


Copyright and Licensing

The package is Crown copyright (c) 2020, Statistics New Zealand on behalf of the New Zealand Government, and is licensed under the MIT License.

This document is Crown copyright (c) 2020, Statistics New Zealand on behalf of the New Zealand Government, and is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit https://creativecommons.org/licenses/by/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.

Copy Link

Version

Install

install.packages('simplevis')

Monthly Downloads

259

Version

3.1.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

David Hodge

Last Published

May 7th, 2021

Functions in simplevis (3.1.0)

ggplot_boxplot_col_facet

ggplot boxplot that is coloured
ggplot_line_facet

Line ggplot that is facetted.
ggplot_line_col_facet

Line ggplot that is coloured and facetted.
ggplot_sf_col_facet

Map of simple features in ggplot that is coloured and facetted.
ggplot_point_col

Point ggplot that is coloured.
example_sf_polygon

Example sf polygon object.
example_sf_point

Example sf point object.
ggplot_vbar

Vertical bar ggplot.
sv_pal

Get default palette.
leaflet_sf

Map of simple features in leaflet.
leaflet_basemap

Basemap stack in leaflet.
sv_labels_from_cuts

Numeric legend labels.
ggplot_sf_facet

Map of simple features in ggplot that is facetted.
plotly_camera

Remove plotly buttons from the mode bar, other than the camera.
theme_sf

Theme for ggplot maps of simple features.
ggplot_vbar_col

Vertical bar ggplot that is coloured.
plotly_col_legend

Change colour legend elements order.
theme_vbar

Theme for vertical bar ggplots.
ggplot_boxplot

Boxplot ggplot.
ggplot_boxplot_col

ggplot boxplot that is coloured
ggplot_hbar_col

Horizontal bar ggplot that is coloured.
ggplot_hbar

Horizontal bar ggplot.
ggplot_sf

Map of simple features in ggplot.
ggplot_vbar_col_facet

Vertical bar ggplot that is coloured and facetted.
run_template

Run shiny template with option to download.
ggplot_sf_col

Map of simple features in ggplot that is coloured.
ggplot_vbar_facet

Vertical bar ggplot that is facetted.
ggplot_line_col

Line ggplot that is coloured.
ggplot_line

Line ggplot.
sv_colnames_to_present

Convert column names to snake case and then to sentence case.
ggplot_hbar_col_facet

Horizontal bar ggplot that is coloured and facetted.
theme_line

Theme for line ggplots.
theme_hbar

Theme for horizontal bar ggplots.
%>%

Pipe operator
theme_boxplot

Theme for box ggplots.
ggplot_hbar_facet

Horizontal bar ggplot that is facetted.
nz

New Zealand coastline.
ggplot_point_facet

Point ggplot that is facetted.
ggplot_point_col_facet

Point ggplot that is coloured and facetted.
theme_mobile_graph

Extra theme elements for ggplot2 graphs on mobile devices
sv_font_size_title

Get default font_size_title
mutate_text

Add a quick tooltip text column to data.
theme_point

Theme for point ggplots.
leaflet_sf_col

Map of simple features in leaflet that is coloured.
x_numeric_breaks

Calculate the breaks for a x axis numeric vector.
y_numeric_breaks

Calculate the breaks for a y axis numeric vector.
sv_font_size_body

Get default font_size_body
theme_mobile_map

Extra theme elements for ggplot2 maps on mobile devices
sv_x_zero_adjust

Automatically adjust x_zero and x_zero_line if necessary
sv_y_zero_adjust

Automatically adjust y_zero and y_zero_line if necessary
ggplot_boxplot_facet

Boxplot ggplot that is facetted.
ggplot_point

Point ggplot.