as.data.frame.bm_bitmap | R Documentation |
as.matrix.bm_matrix()
casts bm_bitmap()
objects to a (normal) integer matrix
and bm_pixmap()
objects to a (normal) character matrix (of color strings).
## S3 method for class 'bm_bitmap'
as.data.frame(x, ..., filtrate = FALSE)
## S3 method for class 'bm_pixmap'
as.data.frame(x, ..., filtrate = FALSE)
x |
Either a |
... |
Currently ignored. |
filtrate |
If |
A data frame with "x", "y", and "value" columns.
font_file <- system.file("fonts/fixed/4x6.yaff.gz", package = "bittermelon")
font <- read_yaff(font_file)
bm <- as_bm_bitmap("RSTATS", font = font)
df <- as.data.frame(bm, filtrate = 1L)
if (require("grid")) {
grid.newpage()
grid.rect(df$x * 0.6, df$y * 0.6, width = 0.5, height = 0.5,
gp = gpar(fill = 'black'), default.units = 'cm')
}
corn <- farming_crops_16x16()$corn$portrait
df <- as.data.frame(corn)
if (require("grid")) {
grid.newpage()
grid.circle(df$x * 0.6, df$y * 0.6, r = 0.25,
gp = gpar(fill = df$value), default.units = 'cm')
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.