inst/README.markdown

Linux Build Status Windows Build status CRAN RStudio mirror downloads Coverage Status

spark

This is an R port of spark.sh.

The spark.sh wiki has some cool usage examples.

Installation

Install it from github, with the devtools package:

devtools::install_github("gaborcsardi/spark")
library(spark)

Enhancements

The R package has some improvements compared to the original shell implementation.

Scaling

The length of the spark line can be fitted to the width of the teminal window:

spark(lynx, width = "auto")
##> ▁▁▂▄▆▇▃▁▁▁▄▄▂▁▁▁▁▃▃▁▁▁▂▄▃▁▁▁▂▆▆▁▁▁▂▃▂▁▁▁▂▄▅▂▁▁▁▁▃▅▁▁▁▂▇█▄▁▁▂▅▅▅▂▁▁▁▂▄▄▂▁▂▃▄

Matrices

Matrices can be plotted row-wise:

spark(t(EuStockMarkets), width="auto", common_scale = FALSE)
##> ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▁▂▂▂▂▂▂▂▂▂▂▂▂▂▂▃▃▃▃▃▄▄▄▅▅▆▅▅▅▆▆▇▇███
##> ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▃▃▃▃▃▃▃▃▃▃▃▄▄▄▅▅▆▅▅▅▆▆▇█████
##> ▁▁▁▁▁▁▁▁▁▂▁▁▁▁▁▁▁▁▁▁▁▁▂▂▂▂▂▂▂▂▂▁▂▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▂▂▂▁▂▂▂▂▃▃▃▄▄▄▄▅▄▄▄▅▇▇███
##> ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▂▂▁▂▂▂▂▂▂▃▃▂▂▂▂▂▂▂▂▂▂▂▂▂▃▃▃▃▃▃▃▄▃▄▄▄▄▄▄▄▄▄▅▅▅▆▆▆▆▆▆▇▇█████

Marking minima and maxima

spark(lh, max = crayon::red)
##> ▄▄▄▄▃▁▄▄▅▃▂▂▄▂▇▇▅▄▄▂▂▂▅▇▄▃▃▆▆▅▅▄▅▄▂▂▁▁▃███▇▅▃█▇▆


Try the spark package in your browser

Any scripts or data that you put into this service are public.

spark documentation built on July 21, 2017, 1:02 a.m.