Skip to content

Latest commit

 

History

History
72 lines (43 loc) · 2.45 KB

README.md

File metadata and controls

72 lines (43 loc) · 2.45 KB

Linux Build Status Windows Build status CRAN RStudio mirror downloads

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)
##> ▄▄▄▄▃▁▄▄▅▃▂▂▄▂▇▇▅▄▄▂▂▂▅▇▄▃▃▆▆▅▅▄▅▄▂▂▁▁▃███▇▅▃█▇▆