Skip to the content.

Time series data visualization made easy for Excel users and R programmers.

R-CMD-check

Installation

  1. Download RStudio or R.
  2. Open RStudio or R, and install the package devtools if you don’t have it already:
    install.packages("devtools", repos = "http://cran.us.r-project.org")
    

    As an alternative to devtools you can use remotes.

  3. With the devtools package you can install nicerplot directly from github.
    devtools::install_github("data-science-made-easy/nicerplot")
    

Congratulations, you now have the cutting-edge development version of nicerplot!

In some cases, however, e.g. if you want work on common version together with others, you may prefer to install a stable release. In that case you can add ref = <tag>, to the above install_github command. You can find the tag left of the release (e.g. ref = 'v0.1.2').

Hello World example

The example below defines a data.frame with two series of data:

x <- 0:6
d <- data.frame(x, first = (6 - x)^2, second = x^2)
nicerplot::nplot(d, title = 'Hello World', x_title = 'x', y_title = 'y', footnote = "just an example")

This generates a figure in./generated/hello-world.png in your working directory (see: getwd()):

Nicerplot can visualize data in the following objects:

The manual explains in great detail how to structure the above objects well.

Change the layout

Instead of lines you can plot ‘stacked bars’ by using parameter type = 'bar=' (use type = 'bar-- for shouldered bars):

library(nicerplot) # this exports function 'nplot()'
nplot(d, title = 'Shouldered bars', x_title = 'x', y_title = 'y', type = 'bar--', file = 'Hello-World-shouldered-bars')
nplot(d, title = 'Stacked bars', x_title = 'x', y_title = 'y', footnote = 'with turn = TRUE', type = 'bar=', file = 'Hello-World-stacked-bars', turn = TRUE)

Manual

The manual provides many other examples. Below each figure in this manual you can find the R-code to reproduce that figure with this package.

Details

The default