5

I would like to send to someone else a presentation that I have created using R and slidfy, but it contains sensitive information, so putting it up onto github pages using the gh-pages branch and then sending the URL isn't really an option, since all github pages are public, as suggested here.

Pushing it up to the glimmer shiny server as well seems a bit unsecure too...(I would ideally like to do this for free so setting up a server to host the one presentation seems a bit cumbersome and overkill for my purposes)

I don't think dropbox would work either since any URL link that is produced if someone else types it into an address bar, would probably be able to download it and view the sensitive information...

Is there a way of sending the presentation (by email or other methods) that contains all the necessary files for it to work, so that a person who doesn't use R can open it and view it easily. (i.e. without having to send them a zip file of all the files (i.e. the assets and libraries and figure folders etc), asking them to unzip it and then opening the index.html file)?

Edit

I forgot to mention that the presentations include nvd3 and morrisjs graphs too, making it difficult to bring over all the files in one go...

Edit2

Given all the libraries used are public libraries, is there a way for it to reference a URL instead of a local drive?

4

3 回答 3

7

这是使用Slidify的方法。有两个技巧可以使用。

  1. mode: standalone在您的 YAML 前文中指定。这确保了所有与幻灯片相关的 JS 和 CSS 资产都从在线 CDN 提供,并且所有静态图像都转换为数据 URL。

  2. n1$print('mychart', include_assets = TRUE, cdn = TRUE)在您的 knitr 代码块中打印图表时使用。这可确保所有图表相关资产都包含在在线 CDN 中并提供服务。请注意,对于每个库,您应该只使用一次 include_assets,以免重复。

  3. 这种方法不是很健壮,因为您在单个文件中链接到多个 JS 库,因此可能存在冲突。例如,MorrisJS 不能很好地与 Google IO2012 配合使用,因为 Google IO2012 使用requireJS并且由于某种原因引发了冲突。

您还可以在 RStudio 演示文稿中使用相同的代码块并将它们保存为独立的 HTML。这是RPres 格式的相同演示文稿。

---
title       : Standalone Presentation with Slidify
author      : Ramnath Vaidyanathan
mode        : standalone
---

## Plain Text

This is a slide with plain text

> 1. Point 1
> 2. Point 2
> 3. Point 3

---

## R Plot

```{r message = F}
require(ggplot2)
qplot(wt, mpg, data = mtcars)
```


---

## NVD3 Plot

```{r results = 'asis', comment = NA, message = F, echo = F}
require(rCharts)
n1 <- nPlot(mpg ~ wt, data = mtcars, type = 'scatterChart', group = 'gear')
n1$print('chart2', include_assets = TRUE, cdn = TRUE)
```

<style>
.rChart {
  height: 500px;
}
</style>


--- 

## Another NVD3 Plot

```{r results = 'asis', comment = NA, message = F, echo = F}
require(rCharts)
n2 <- nPlot(mpg ~ cyl, data = mtcars, type = 'scatterChart')
n2$print('chart3')
```
于 2013-09-12T20:29:00.347 回答
2

另一种选择是

1) Open the HTML file in Chrome, 
2) Choose the option to print 
3) Save it as .pdf. 

它并不适合所有情况,但绝对是一个不错的选择。

于 2013-12-22T22:39:21.057 回答
1

我认为你的最后一种方法是最安全的。

你真的要使用 slidify 吗?使用最新(预览)版本的Rstudio,您可以即时创建HTML5 演示文稿。它比滑动要容易得多。要分发幻灯片,您只需邮寄独立的输出 html 文件(如果您不使用 nvd3 或乳胶之类的花哨的东西)。这是更多信息。 链接 1 链接2 链接3

于 2013-09-12T11:10:52.183 回答