Movatterモバイル変換


[0]ホーム

URL:


Prettified Base Graphics

R-CMD-checkCRANLifecycle: maturingCoverage statusDownloads

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

Installation

The package is still being developed and the graphs are subject tochange. 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 aprettyB, it changes theunderlyingpar() andpalette(). You can resetthis via

prettyB::reset_prettyB()

The core idea ofprettyB is that no new argumentsare introducted to the plot functions. This means, that no changes toexisting 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

Package Rationale

This package isnot a replacement forggplot2 or other R related plotting packages. Instead,it has a few simple aims

Since the generated plots byprettyB use standardbase graphics, with no new arguments, this makes plots future proof. Asa fall-back, just remove the_p.

I picked up the general style a few years ago, but the bookFundamentalsof Data Visualization has made it a bit more consist. The authoralso provided a freeonline version.

Other information


Development of this package was supported byJumping Rivers


[8]ページ先頭

©2009-2025 Movatter.jp