Description Usage Arguments Examples
Convert an image file to a polygon
1 2 3 4 5 6 7 8 9 | letterToPolygon(
ch,
fontfamily = "Helvetica",
fontsize = 576,
tol = 1,
dim = c(480, 480),
threshold = 0.5,
var = "red"
)
|
ch |
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 |
tol |
tolerance |
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. |
threshold |
numerical cutoff between 0 and 1 |
var |
one of "red", "green", "blue". |
1 2 3 4 | library(ggplot2)
letter <- letterToPolygon("R", fontfamily="Helvetica")
qplot(x, y, geom="polygon", data = letter, fill=I("black"), alpha=I(0.8))+
coord_equal()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.