tests/tests.R

library(txtplot)

txtplot(1000000:1000004, 100000*c(1, 2, 3, 2, 1))
txtplot(1000000:1000004, 100000*c(1, 2, 3, 2, 1),
        xlab = "Test 1", ylab = "Test 2")
txtplot(rep(0,10), 0:9)
txtplot(0:9, rep(0,10))
txtplot(rep(10,10), 0:9)
txtplot(0:9, rep(10,10))

txtplot(runif(100), runif(100))
a <- seq(0, 3, length=11)
b <- exp(-a)
txtplot(a, b, pch="o")
txtcurve(x/(x+0.1), 0, 1, xlab = "Dose", ylab="Response")

txtplot(a, b, xlim = c(1,2), ylim = c(0,1))

txtboxplot(rexp(100), xlab = "waiting time")

set.seed(1)
txtplot(runif(10000,0,115000),100001:110000)
txtplot(runif(10000,-115000,0), seq(1,9,length=10000))
txtboxplot(runif(10000,0,115000))
txtboxplot(runif(10000,-115000.0))

z <- datasets::volcano
txtimage(z, alphabet = c(0:9, letters, LETTERS))
txtimage(z, 20, 10, yaxis = 'd', transpose = FALSE, alphabet = ' .:-+=#')
z[10,10] <- +Inf
stopifnot(inherits(try(txtimage(z), TRUE), 'try-error'))
z[10,10] <- NA
z[11,11] <- NaN
txtimage(z, na.char = '?', Lanczos = 1)
txtimage(matrix(10, 200, 200))

Try the txtplot package in your browser

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

txtplot documentation built on April 5, 2020, 9:07 a.m.