letterObject: Convert a text element into an R object

Description Usage Arguments Value Examples

View source: R/text.r

Description

Convert a text element into an R object

Usage

1
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

1
2
3
plot(letterObject("g", fontfamily="Garamond", fontsize=400))
plot(letterObject("q", fontsize=400))
plot(letterObject("B"))

gglogo documentation built on Jan. 29, 2020, 1:09 a.m.