0% found this document useful (0 votes)
54 views5 pages

Package Txtplot': R Topics Documented

The txtplot package provides functions for creating basic ASCII text-based plots directly in the terminal, including functions for boxplots (txtboxplot), basic plotting (txtplot), curve plotting (txtcurve), density estimation (txtdensity), autocorrelation (txtacf), and bar charts (txtbarchart). The package aims to produce rudimentary graphics in terminals to explore and visualize data when full-featured graphics are not available or desired.

Uploaded by

Marcelo Prado
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views5 pages

Package Txtplot': R Topics Documented

The txtplot package provides functions for creating basic ASCII text-based plots directly in the terminal, including functions for boxplots (txtboxplot), basic plotting (txtplot), curve plotting (txtcurve), density estimation (txtdensity), autocorrelation (txtacf), and bar charts (txtbarchart). The package aims to produce rudimentary graphics in terminals to explore and visualize data when full-featured graphics are not available or desired.

Uploaded by

Marcelo Prado
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Package ‘txtplot’

February 20, 2015


Type Package
Title Text based plots
Version 1.0-3
Date 2012-07-25
Author Bjoern Bornkamp
Maintainer Bjoern Bornkamp <[email protected]>
Description Provides functions to produce rudimentary ascii graphics
directly in the terminal window. Provides a basic plotting
function (and equivalents of curve, density, acf and barplot)
as well as a boxplot function.
License LGPL
LazyLoad yes
Repository CRAN
Date/Publication 2012-07-25 05:19:59
NeedsCompilation no

R topics documented:
txtboxplot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
txtplot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Index 5

txtboxplot Text based boxplot

Description
Produces rudimentary ascii boxplots. The boxplot statistics are produced using the boxplot.stats
function.

1
2 txtplot

Usage
txtboxplot(..., range = 1.5, legend = NULL, xlab = NULL,
width = round(options()$width * 0.8))

Arguments
... Numeric vectors for which a boxplot should be produced
range This determines how far the plot whiskers extend out from the box. See boxplot.stats
and the coef function for details.
legend Logical determining whether a legend should be drawn. If legend is NULL
there will be a legend drawn in case there is more than one boxplot.
xlab label for x-axis of boxplot, if NULL no x-label will be plotted
width Width of the plot

Note
Due to rounding to a relatively crude grid results can only be approximate. E.g. the equally spaced
axis ticks may be non-equally spaced in the plot.

Author(s)
Bjoern Bornkamp

See Also
txtplot

Examples
rand1 <- rnorm(100, 1, 2)
rand2 <- rnorm(50, 2, 2)
rand3 <- rnorm(50, 2, 5)
txtboxplot(rand1)
txtboxplot(rand1, rand2, rand3)

txtplot Ascii graphics

Description
Provides a function to produce rudimentary ascii graphics directly in the terminal window.
txtplot provides the basic plotting function of two numeric vectors. All other functions below are
based on this.
txtcurve is a text based equivalent of the curve function
txtdensity is a text based density estimation function based on the density function
txtacf is a text based equivalent of the acf function and based on the acf function.
txtbarchart is a text based barplot and plots the relative frequences of the occurences of the
different levels of a factor (in percent)
txtplot 3

Usage

txtplot(x, y = NULL, pch = "*", width = round(options()$width*0.8),


height = round(0.25*width), xlab = NULL, ylab = NULL,
xlim = NULL, ylim = NULL)

txtcurve(expr, from = NULL, to = NULL, n = 101,


pch = "*", width = round(options()$width*0.8),
height = round(0.25*width), xlab = NULL, ylab = NULL)

txtdensity(x, pch = "*", width = round(options()$width*0.8),


height = round(0.25*width), xlab = NULL, ylab = NULL)

txtacf(x, pch = "*", lag.max = 20, type = c("correlation", "covariance", "partial"),


na.action = na.fail, demean = TRUE, width = round(options()$width*0.8),
height = round(0.25*width), xlab = NULL, ylab = NULL)

txtbarchart(x, pch = "*", width = round(options()$width*0.8),


height = round(0.25*width), ylab = NULL)

Arguments

x numeric containing the x-values to plot (for txtbarchart this needs to be of


class factor). NA, NaN are removed for plotting. Infinities cause an error
y numeric containing the x-values to plot (needs to be of the same length as x).
If NULL the numeric x is plotted against 1:length(x). NA, NaN are removed
for plotting. Infinities cause an error
pch Plotting symbol
width, height Width and height of the plots in points
xlab, ylab labels for x and y axis
xlim, ylim limits for x and y axis in plot, if equal to NULL automatically determined from
x and y.
expr An expression to plot (containing x)
from,to Defines boundaries of plotting region for expr in txtcurve
n integer specifying the number of x values between from and to
lag.max, type, na.action, demean
arguments for call of acf function, see ?acf for details

Note

Due to rounding to a relatively crude grid results can only be approximate! The equally spaced axis
ticks, for example, may be non-equally spaced in the plot.
Due to the crude grid also there might be several points per pixel. The function uses the same
plotting symbol no matter how many points coincide on one pixel
4 txtplot

Author(s)
Bjoern Bornkamp

See Also
txtboxplot

Examples
## basic plotting function
require(stats)
txtplot(cars[,1], cars[,2])
## can include axis labels when desired
txtplot(cars[,1], cars[,2], xlab = "speed", ylab = "distance")

## text based density plot


txtdensity(rnorm(500))

## text based plotting of functions


txtcurve(x/(x+1), 0, 4, xlab = "Emax model")

## text based acf


txtacf(rnorm(100))

## text based barchart


x <- factor(c("orange", "orange", "red", "green", "green", "red",
"yellow", "purple", "purple", "orange"))
txtbarchart(x)
Index

∗Topic hplot
txtboxplot, 1
txtplot, 2

boxcore (txtboxplot), 1
boxplot.stats, 2

checkNA (txtplot), 2

drawLegend (txtplot), 2

getRng (txtplot), 2
getTicks (txtplot), 2

insEOL (txtplot), 2

txtacf (txtplot), 2
txtbarchart (txtplot), 2
txtboxplot, 1, 4
txtcurve (txtplot), 2
txtdensity (txtplot), 2
txtplot, 2, 2

You might also like