Package 'asciichartr'

Title: Lightweight ASCII Line Graphs
Description: Create ASCII line graphs of a time series directly on your terminal in an easy way. There are some configurations you can add to make the plot the way you like. This project was inspired by the original 'asciichart' package by Igor Kroitor.
Authors: Brian Lee Mayer
Maintainer: Brian <[email protected]>
License: MIT + file LICENSE
Version: 0.1.0
Built: 2025-01-20 04:40:16 UTC
Source: https://github.com/blmayer/asciichartr

Help Index


ASCII chart of vector. Generate an ascii chart for a series of numbers.

Description

asciiPlot returns a character string of a chart for given series.

Usage

asciiPlot(series, cfg = list())

Arguments

series

A numeric vector, missing data values in the series can be specified as a NA.

cfg

A named list with some options: height specifies the number of rows the graph should occupy. It can be used to scale down a graph with large data values. format specifies a C format string used to format the labels on the y-axis. The default value is " symbols provides a list of single characters to use for drawing the curve. offset changes what column will the y-axis be drawn. Default is 3. min and max will clamp the y-axis and all values.

Value

A character string

Examples

series <- c(1,2,3,4,4,3,2,1)
cat(asciiPlot(series))

series <- c(1,2,3,NA,4,3,NA,1)
cat(asciiPlot(series))

series <- c(1,2,3,4,NA,4,3,2,1)
cat(asciiPlot(series, list('min' = 0)))

## Not run: 
cat(asciiPlot(c(NA, NA)))

## End(Not run)