是否可以将html_notebook
aka r notebook
格式与plotly
一起使用?
当我使用下面显示的rmarkdown文件(名为temp.Rmd
)时,我可以knit to HTML
并且一切正常 - 也就是说,我可以查看正确的temp.html
文件。但是,当我使用Preview Notebook
中的RStudio
按钮打开预览窗格或查看temp.nb.html
文件时,我错过了plotly
输出。
temp.Rmd
---
title: "R Notebook"
output:
html_notebook: default
html_document:
df_print: paged
---
Some text here.
```{r message = FALSE, warning = FALSE}
library(ggplot2)
library(plotly)
p <- ggplot(mtcars, aes(x = cyl, y = mpg)) + geom_point()
ggplotly(p, width = 500, height = 500)
mtcars
```
More text here.
会话信息
Session info ---------------------------------------------------------------
setting value
version R version 3.5.0 (2018-04-23)
system x86_64, mingw32
ui RStudio (1.2.593)
language (EN)
collate English_United States.1252
tz America/New_York
date 2018-05-01
ggplot2 * 2.2.1.9000 2018-04-27 Github (tidyverse/ggplot2@1d537ce)
plotly * 4.7.1.9000 2018-04-27 Github (ropensci/plotly@38f447f)