context("docx images")
png(filename = "img.png", width = 4*72, height = 4*72)
plot.new()
points(.5,.5)
dev.off()
test_that("[docx] image with no size generate an error", {
skip_if_not(check_valid_java_version())
doc <- docx( )
doc <- try( addImage(doc, "img.png"), silent = TRUE)
expect_is(doc, "try-error" )
})
test_that("[docx] image with size generate no error", {
skip_if_not(check_valid_java_version())
doc <- docx( )
doc <- try( addImage(doc, "img.png",
width = 4, height = 4 ), silent = TRUE)
expect_is(doc, "docx" )
})
unlink("img.png", force = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.