c 自动生成html报告,如何使用rmarkdown创建自包含的html报告?

如何使用自包含图像从.Rmd文件生成html文档?我正在使用bsplus包和rmarkdown创建一个图像轮播.当我在.Rproj工作目录中打开.html输出时,它工作正常,但是当我将文件发送给某人时,图像不再显示.

是否有可能获得带有相应图像的“自包含”.html文件输出?或者我应该发送所有文件夹依赖项?

代码如何看起来的例子……

---

title: "test"

author: "me"

date: "today"

output: html_document

---

```{r setup, include=FALSE}

knitr::opts_chunk$set(echo = TRUE)

```

## R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see .

When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

```{r carousel}

bs_carousel(id = "the_beatles", use_indicators = TRUE) %>%

bs_append(

content = bs_carousel_image(src = image_uri("img/john.jpg")),

caption = bs_carousel_caption("John Lennon", "Rhythm guitar, vocals")

) %>%

bs_append(

content = bs_carousel_image(src = image_uri("img/paul.jpg")),

caption = bs_carousel_caption("Paul McCartney", "Bass guitar, vocals")

) %>%

bs_append(

content = bs_carousel_image(src = image_uri("img/george.jpg")),

caption = bs_carousel_caption("George Harrison", "Lead guitar, vocals")

) %>%

bs_append(

content = bs_carousel_image(src = image_uri("img/ringo.jpg")),

caption = bs_carousel_caption("Ringo Starr", "Drums, vocals")

)

```

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值