Learn R Programming

gglogo (version 0.1.5)

letterObject: Convert a text element into an R object

Description

Convert a text element into an R object

Usage

letterObject(ch, fontfamily = "Helvetica", fontsize = 576, dim = c(480, 480))

Arguments

ch

text to be converted, usually just a single letter

fontfamily

R has a few default fonts that are always available, such as e.g. Helvetica, Arial, Courier New, and Garamond. Other fonts might be available depending on the platform used.

fontsize

by default 576. If the resulting string exceeds the boundary of the matrix returned, reduced font size

dim

vector of length two specifying width and height (in pixels) of the temporary jpg file created for the letter. Defaults to 480 x 480 pixels.

Value

three dimensional matrix of dimension 480 x 480 x 3 of the pixel values, black background and white letter

Examples

Run this code
# NOT RUN {
plot(letterObject("g", fontfamily="Garamond", fontsize=400))
plot(letterObject("q", fontsize=400))
plot(letterObject("B"))
# }

Run the code above in your browser using DataLab