library(marshal)
if (requireNamespace("magick", quietly = TRUE)) {
img <- magick::logo
print(img)
## Assert non-marshallability
stopifnot(!marshallable(img))
## Marshal read-only connection, which records the
## current state, including the current file position.
res <- tryCatch({
marshal(img)
}, error = identity)
stopifnot(
inherits(res, "error"),
inherits(res, "MarshalNotSupportedError")
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.