Learn R Programming

bookdownplus (version 1.5.8)

include_image: Insert an image from a url

Description

This function is supposed to be used in R code chunks or inline R code expressions.

  • If the output is not pdf, then this function works the samge as knitr::include_graphics().

  • If the output is pdf, then the image will be downloaded to the img_dir directory and inserted.

  • If the image is in gif format, then it will be converted into png before inserted into pdf.

Usage

include_image(img_url, img_dir = "images")

Arguments

img_url

The url of the image

img_dir

The path of the local image directory

Value

The same as the knitr::include_graphics() function