【问题标题】:Rmarkdown hist()降价历史记录()
【发布时间】:2016-07-04 00:47:51
【问题描述】:

我正在尝试将我的 rmd 文件编织到 Rstudio 中的 html,但是当它到达 hist() 时,它会退出并出现错误:“... withCallingHandlers -> withVisible -> eval -> eval -> hist”。任何帮助都非常感谢。

代码类似这样:

```{r}
hist(diamonds$carat)
```

我的会话信息:

R version 3.2.1 (2015-06-18), 
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

locale:
[1] LC_COLLATE=Russian_Russia.1251  LC_CTYPE=Russian_Russia.1251    LC_MONETARY=Russian_Russia.1251
[4] LC_NUMERIC=C                    LC_TIME=Russian_Russia.1251    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] ggthemes_3.0.2 ggplot2_2.0.0 

【问题讨论】:

    标签: r rstudio


    【解决方案1】:

    RStudio(非常正确)在干净的会话中编织文档。因此,您在当前会话中加载了哪些包是无关紧要的。

    现在,diamondsggplot2 附带的示例数据集。如果你想使用它,你需要在你的 RMarkdown 文档中加载ggplot2(或者至少是数据集):

    ```{r}
    data(diamonds, package = 'ggplot2')
    ```
    

    【讨论】:

    • @HongOoi 我在回答的第一段中解决了这个问题。
    • @KonradRudolph 谢谢!有帮助!
    猜你喜欢
    • 1970-01-01
    • 2015-10-08
    • 1970-01-01
    • 2013-04-25
    • 1970-01-01
    • 2021-01-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多