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.0.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

David Hodge

Last Published

April 30th, 2021

Functions in simplevis (3.0.0)

example_sf_point

Example sf point object.
ggplot_hbar

Horizontal bar ggplot.
ggplot_boxplot_col_facet

ggplot boxplot that is coloured
ggplot_boxplot

Boxplot ggplot.
ggplot_boxplot_facet

Boxplot ggplot that is facetted.
ggplot_hbar_col

Horizontal bar ggplot that is coloured.
example_stars_2

Example stars object 2.
example_stars

Example stars object.
ggplot_boxplot_col

ggplot boxplot that is coloured
example_sf_polygon

Example sf polygon object.
ggplot_point

Point ggplot.
ggplot_line_facet

Line ggplot that is facetted.
ggplot_line_col_facet

Line ggplot that is coloured and facetted.
ggplot_point_col

Point ggplot that is coloured.
ggplot_point_facet

Point ggplot that is facetted.
ggplot_point_col_facet

Point ggplot that is coloured and facetted.
ggplot_vbar_col

Vertical bar ggplot that is coloured.
ggplot_vbar

Vertical bar ggplot.
plotly_legend_order

Order plotly legend elements.
ggplot_sf_col

Map of simple features in ggplot that is coloured.
plotly_camera

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

Map of simple features in ggplot.
ggplot_line

Line ggplot.
ggplot_sf_facet

Map of simple features in ggplot that is facetted.
nz

New Zealand coastline.
sv_labels_from_cuts

Numeric legend labels.
ggplot_vbar_col_facet

Vertical bar ggplot that is coloured and facetted.
ggplot_hbar_facet

Horizontal bar ggplot that is facetted.
sv_pal

Get default palette.
ggplot_hbar_col_facet

Horizontal bar ggplot that is coloured and facetted.
theme_sf

Theme for ggplot maps of simple features.
theme_boxplot

Theme for box ggplots.
sv_y_zero_adjust

Automatically adjust y_zero and y_zero_line if necessary
theme_point

Theme for point ggplots.
%>%

Pipe operator
leaflet_basemap

Basemap stack in leaflet.
plotly_legend_rev

Reverse plotly legend elements.
ggplot_line_col

Line ggplot that is coloured.
leaflet_sf

Map of simple features in leaflet.
theme_line

Theme for line ggplots.
theme_hbar

Theme for horizontal bar ggplots.
theme_mobile_map

Extra theme elements for ggplot2 maps on mobile devices
ggplot_sf_col_facet

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

Vertical bar ggplot that is facetted.
run_template

Run shiny template with option to download.
sv_colnames_to_present

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

Theme for vertical bar ggplots.
x_numeric_breaks

Calculate the breaks for a x axis numeric vector.
sv_font_size_body

Get default font_size_body
sv_font_size_title

Get default font_size_title
mutate_text

Add a quick tooltip text column to data.
leaflet_sf_col

Map of simple features in leaflet that is coloured.
theme_mobile_graph

Extra theme elements for ggplot2 graphs on mobile devices
y_numeric_breaks

Calculate the breaks for a y axis numeric vector.
sv_x_zero_adjust

Automatically adjust x_zero and x_zero_line if necessary