as.array.bm_bitmap | R Documentation |
as.array.bm_bitmap()
/ as.array.bm_pixmap()
casts bm_bitmap()
/ bm_pixmap()
objects to an array of numeric values representing the RGBA channels.
These arrays can be used in functions such as png::writePNG()
.
## S3 method for class 'bm_bitmap'
as.array(
x,
...,
first_row_is_top = TRUE,
col = getOption("bittermelon.col", col_bitmap)
)
## S3 method for class 'bm_pixmap'
as.array(x, ..., first_row_is_top = TRUE)
x |
Either a |
... |
Currently ignored. |
first_row_is_top |
If |
col |
Character vector of R color specifications. First color is used for values equal to 0, second color for values equal to 1, etc. |
corn <- farming_crops_16x16()$corn$portrait
a <- as.array(corn)
f <- tempfile(fileext = ".png")
png::writePNG(a, f)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.