Search code examples
rr-markdownknitrbookdown

set width of embedded url


In R, the function include_url() from the knitr package allows to set the height, but not the width of an embedded iframe.

knitr::include_url("https://www.youtube.com/embed/9bZkp7q19f0", height="315")

The above will embedd the youtube with height =315 and width=672. Is there a way to set the width myself?


Solution

  • Use the chunk option out.width, e.g., out.width="100%".