All Projects → jumpingrivers → prettyB

jumpingrivers / prettyB

Licence: other
Prettified base graphics

Programming Languages

r
7636 projects

Projects that are alternatives of or similar to prettyB

antiword
R wrapper for antiword utility
Stars: ✭ 47 (-16.07%)
Mutual labels:  rstats
rinat
A programmatic interface to iNaturalist
Stars: ✭ 36 (-35.71%)
Mutual labels:  rstats
cattonum
Encode Categorical Features
Stars: ✭ 31 (-44.64%)
Mutual labels:  rstats
cyphr
Humane encryption
Stars: ✭ 91 (+62.5%)
Mutual labels:  rstats
rfishbase
R interface to the fishbase.org database
Stars: ✭ 79 (+41.07%)
Mutual labels:  rstats
mrgsolve
Simulate from ODE-based population PK/PD and QSP models in R
Stars: ✭ 84 (+50%)
Mutual labels:  rstats
ciencia datos
El curso en español, de acceso abierto y gratuito más grande del mundo sobre Ciencia de Datos en salud.
Stars: ✭ 66 (+17.86%)
Mutual labels:  rstats
regista
An R package for soccer modelling
Stars: ✭ 71 (+26.79%)
Mutual labels:  rstats
githubdashboard
#rstats github flexdashboard
Stars: ✭ 40 (-28.57%)
Mutual labels:  rstats
ctv
CRAN Task View Initiative
Stars: ✭ 17 (-69.64%)
Mutual labels:  rstats
pbapply
Adding progress bar to '*apply' functions in R
Stars: ✭ 115 (+105.36%)
Mutual labels:  rstats
epidata
📉 Tools to Retrieve Economic Policy Institute Data Library Extracts in R
Stars: ✭ 20 (-64.29%)
Mutual labels:  rstats
elpresidente
🇺🇸 Search and Extract Corpus Elements from 'The American Presidency Project'
Stars: ✭ 21 (-62.5%)
Mutual labels:  rstats
rbcb
R interface to Brazilian Central Bank web services
Stars: ✭ 63 (+12.5%)
Mutual labels:  rstats
WikidataQueryServiceR
An R package for the Wikidata Query Service API
Stars: ✭ 23 (-58.93%)
Mutual labels:  rstats
ggchicklet
🀫 Create Chicklet (Rounded Segmented Column) Charts
Stars: ✭ 130 (+132.14%)
Mutual labels:  rstats
rglobi
R library to access species interaction data of http://globalbioticinteractions.org
Stars: ✭ 12 (-78.57%)
Mutual labels:  rstats
lorem
Generate Lorem Ipsum Text
Stars: ✭ 18 (-67.86%)
Mutual labels:  rstats
NLMR
📦 R package to simulate neutral landscape models 🏔
Stars: ✭ 57 (+1.79%)
Mutual labels:  rstats
rchess
♛ Chess package for R
Stars: ✭ 68 (+21.43%)
Mutual labels:  rstats

Prettified Base Graphics

R-CMD-check CRAN Lifecycle: maturing Coverage status Downloads

Anyone who uses R Base graphics, have a 100 and 1 tweaks that they use to make the figures more presentable. This package aims to capture the tweaks in one place.

Installation

The package is still being developed and the graphs are subject to change. The package is on CRAN and can be installed in the usual way

install.packages("prettyB")

To install the dev version, try

devtools::install_github("jumpingrivers/prettyB")

The package can then be loaded in the usual way

library("prettyB")

Usage

All plotting functions work exactly as before, with the same inputs. The difference is that the defaults have been changed. For example, compare

op = par(mfrow = c(1, 2))
plot(iris$Sepal.Length, iris$Sepal.Width)
plot_p(iris$Sepal.Length, iris$Sepal.Width)
#> 

When you first call a prettyB, it changes the underlying par() and palette(). You can reset this via

prettyB::reset_prettyB()

The core idea of prettyB is that no new arguments are introducted to the plot functions. This means, that no changes to existing code are required

plot_p(iris$Sepal.Length, iris$Sepal.Width, 
     xlab = "Length", ylab = "Width",
     main = "The Iris data set", 
     sub = "I hate this data too")
#> 

Other plots

The package also prettifies other functions

  • Histograms

    z = rt(100, 4)
    hist(z, main = "The t-distribution")
    hist_p(z, main = "The t-distribution")
  • barplots

    barplot(VADeaths, main = "Death Rates in Virginia")
    barplot_p(VADeaths, main = "Death Rates in Virginia")

Package Rationale

This package is not a replacement for ggplot2 or other R related plotting packages. Instead, it has a few simple aims

  • provide package authors a low dependency method of making their plots look pretty
  • provide academics with a way of generating nice plots, but not worry about future changes in R
  • provide a simple way for improving the look and feel of plots in teaching

Since the generated plots by prettyB use standard base graphics, with no new arguments, this makes plots future proof. As a fall-back, just remove the _p.

I picked up the general style a few years ago, but the book Fundamentals of Data Visualization has made it a bit more consist. The author also provided a free online version.

Other information

  • If you have any suggestions or find bugs, please use the github issue tracker
  • Feel free to submit pull requests

Development of this package was supported by Jumping Rivers

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].