Skip to content

botanize/spark

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Sparklines in the R terminal

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • R 97.9%
  • Makefile 2.1%