| Title: | Generate Braille-Enabled Graphics |
|---|---|
| Description: | Provides tools for rendering and visualizing Braille patterns in R, using the 'liblouis' translation library. For more information see <https://github.com/wininger/yaleBraille>. |
| Authors: | Mike Wininger [aut, cre] (ORCID: <https://orcid.org/0000-0002-7871-3292>), liblouis contributors [ctb, cph] (Authors of the bundled liblouis C library (https://liblouis.io)) |
| Maintainer: | Mike Wininger <[email protected]> |
| License: | LGPL (>= 2.1) |
| Version: | 0.2.3 |
| Built: | 2026-10-03 13:35:46 UTC |
| Source: | https://github.com/wininger/yalebraille |
This package provides plotting functions similar to those found in Base R, but with _br suffixes, indicating Braille-functionality. These functions deliver as output a two-page .pdf file: first page is a braille-annotated graph; second page is the text-based graph. Coding occurs via conventional syntax (i.e. text); translation is executed by the liblouis package. Graphical standards are adapted to facilitate printing onto swell-paper. For more information see <https://github.com/wininger/yaleBraille>.
Mike Wininger, [email protected]
library(yaleBraille) data(yaleSports) translateToBraille(yaleSports$Sport[1], table = "en-ueb-g2.ctb") plot_br(Weight~Height, data=yaleSports)library(yaleBraille) data(yaleSports) translateToBraille(yaleSports$Sport[1], table = "en-ueb-g2.ctb") plot_br(Weight~Height, data=yaleSports)
Create Braille-enabled Bar Plot
barplot_br(...)barplot_br(...)
... |
plot parameters as would typically be used in barplot() |
two-page .pdf file
yale = data.frame(yaleSports) tbl = table(yale$Sport) barplot_br(tbl, over="Bar Chart", main="Yale Athletics Dataset", xlab="x-axis = Sport", ylab="y-axis = Count (n athletes)", stem="newBar") air = airquality air$Feel = cut(air$Temp,breaks=c(0,65,80,1000),labels=c("cool","warm","hot")) tbl = table(air$Feel) barplot_br(tbl, over="Bar Chart", main="Air Quality: NYC (1973)", xlab="x-axis = Temperature Feel", ylab="y-axis = Count (n days)", stem="airBar", cex.main=1.5, cex.axis=3.5, col="purple")yale = data.frame(yaleSports) tbl = table(yale$Sport) barplot_br(tbl, over="Bar Chart", main="Yale Athletics Dataset", xlab="x-axis = Sport", ylab="y-axis = Count (n athletes)", stem="newBar") air = airquality air$Feel = cut(air$Temp,breaks=c(0,65,80,1000),labels=c("cool","warm","hot")) tbl = table(air$Feel) barplot_br(tbl, over="Bar Chart", main="Air Quality: NYC (1973)", xlab="x-axis = Temperature Feel", ylab="y-axis = Count (n days)", stem="airBar", cex.main=1.5, cex.axis=3.5, col="purple")
Create Braille-enabled Box Plot
boxplot_br(...)boxplot_br(...)
... |
plot parameters as would typically be used in boxplot() |
two-page .pdf file
yale = data.frame(yaleSports) boxplot_br(Height~Sport,data=yale, over="Box Plot", main="Yale Athletics Dataset", xlab="x-axis = Sport", ylab="y-axis = Height (inches)", stem="newBox") air = airquality air$Month = as.factor(air$Month) boxplot_br(Ozone~Month,data=air, lwd=2,pch=16,las=3,lty=1, over="Box Plot", main="Air Quality: NYC (1973)", xlab="x-axis = Month (numeric)", ylab="y-axis = Ozone (ppb)", stem="airBox", cex.main=1.5, cex.axis=1.5, col="chocolate1")yale = data.frame(yaleSports) boxplot_br(Height~Sport,data=yale, over="Box Plot", main="Yale Athletics Dataset", xlab="x-axis = Sport", ylab="y-axis = Height (inches)", stem="newBox") air = airquality air$Month = as.factor(air$Month) boxplot_br(Ozone~Month,data=air, lwd=2,pch=16,las=3,lty=1, over="Box Plot", main="Air Quality: NYC (1973)", xlab="x-axis = Month (numeric)", ylab="y-axis = Ozone (ppb)", stem="airBox", cex.main=1.5, cex.axis=1.5, col="chocolate1")
Create Braille-enabled Histogram
hist_br(x, breaks = 20, ...)hist_br(x, breaks = 20, ...)
x |
numerical data for summarizing in histogram |
breaks |
number (plus one) of bins in the histogram |
... |
plot parameters as would typically be used in hist() |
two-page .pdf file
yale = data.frame(yaleSports) hist_br(yale$Weight, over="Histogram", main="Yale Athletics Dataset", xlab="x-axis = Bodyweight (pounds)", ylab="y-axis = Count (n athletes)", stem="newHist") air=airquality hist_br(air$Temp, over="Histogram", main="Air Quality: NYC (1973)", xlab="x-axis = Temperature (deg)", ylab="y-axis = Count (n days)", stem="airHist", cex.main=2, cex.axis=2, col="deeppink1")yale = data.frame(yaleSports) hist_br(yale$Weight, over="Histogram", main="Yale Athletics Dataset", xlab="x-axis = Bodyweight (pounds)", ylab="y-axis = Count (n athletes)", stem="newHist") air=airquality hist_br(air$Temp, over="Histogram", main="Air Quality: NYC (1973)", xlab="x-axis = Temperature (deg)", ylab="y-axis = Count (n days)", stem="airHist", cex.main=2, cex.axis=2, col="deeppink1")
Create Braille-enabled Pie Chart
pie_br(...)pie_br(...)
... |
plot parameters as would typically be used in pie() |
two-page .pdf file
yale = data.frame(yaleSports) tbl = table(yale$Sport) pie_br(tbl, over="Pie Chart", main="Yale Athletics Dataset", xlab=" ", ylab=" ", stem="newPie") air = airquality air$Feel = cut(air$Temp,breaks=c(0,65,80,1000),labels=c("cool","warm","hot")) tbl = table(air$Feel) pie_br(tbl, over="Pie Chart", main="Air Quality: NYC (1973)", xlab="", ylab="", stem="airPie", cex.main=2, cex=1)yale = data.frame(yaleSports) tbl = table(yale$Sport) pie_br(tbl, over="Pie Chart", main="Yale Athletics Dataset", xlab=" ", ylab=" ", stem="newPie") air = airquality air$Feel = cut(air$Temp,breaks=c(0,65,80,1000),labels=c("cool","warm","hot")) tbl = table(air$Feel) pie_br(tbl, over="Pie Chart", main="Air Quality: NYC (1973)", xlab="", ylab="", stem="airPie", cex.main=2, cex=1)
Create Braille-enabled Scatter or Line Plot
plot_br(x, y = NULL, data = NULL, ...)plot_br(x, y = NULL, data = NULL, ...)
x |
variable for plotting (independent variable, if y is not NULL) |
y |
dependent variable for plotting |
data |
data-frame in case formula argument utilized |
... |
plot parameters as would typically be used in plot() |
two-page .pdf file
yale = data.frame(yaleSports) plot_br(Weight~Height,data=yale, over="Scatter Plot", main="Yale Athletics Dataset", xlab="x-axis = Height (inches)", ylab="y-axis = Weight (pounds)", stem="plotScatter") yale = data.frame(yaleSports) plot_br(sort(yale$Weight[1:20]), over="Scatter Plot", main="Yale Athletics Dataset", xlab="Athlete (sorted)", ylab="y-axis = Weight (pounds)", type="b", stem="plotLine") air = airquality plot_br(air$Temp,air$Ozone, over="Scatter Plot", main="Air Quality: NYC (1973)", xlab="x-axis = Temperature (deg)", ylab="y-axis = Ozone (ppb)", stem="airPlot", cex.main=1.5, cex.axis=1.5, col="red", pch=16)yale = data.frame(yaleSports) plot_br(Weight~Height,data=yale, over="Scatter Plot", main="Yale Athletics Dataset", xlab="x-axis = Height (inches)", ylab="y-axis = Weight (pounds)", stem="plotScatter") yale = data.frame(yaleSports) plot_br(sort(yale$Weight[1:20]), over="Scatter Plot", main="Yale Athletics Dataset", xlab="Athlete (sorted)", ylab="y-axis = Weight (pounds)", type="b", stem="plotLine") air = airquality plot_br(air$Temp,air$Ozone, over="Scatter Plot", main="Air Quality: NYC (1973)", xlab="x-axis = Temperature (deg)", ylab="y-axis = Ozone (ppb)", stem="airPlot", cex.main=1.5, cex.axis=1.5, col="red", pch=16)
Translate text to Braille
translateToBraille(text, table)translateToBraille(text, table)
text |
A character string to translate. |
table |
The Braille table to use (e.g., "en-ueb-g2.ctb"). |
A character string of translated Braille.
Adapted from classic dataset from Yale School of Public Health Introduction to Biostatistics courses (EPH-505, EMPH-535, PUBH-505). Date retrieved from Yale Athletics pages.
yaleSportsyaleSports
A data frame with 1,228 rows and 6 variables:
Year of sport team operation
Student athlete team membership
Student athlete full name alpha-sorted and lower-cased
Student athlete class standing
Student athlete height in inch units
Student athlete weight in pounds units
https://yalebulldogs.com (Retrieved Summer, 2018)