R MARKDOWN:代码块运行,但编织时会出现错误

发布于 2025-02-13 08:31:28 字数 348 浏览 0 评论 0原文

我正在使用rstudio云。我正在运行一个rmarkdown文档,当我在文档中运行代码块时,它们正常工作,但是当我试图编织时,我会遇到错误。在我使用代码“ knitr :: opts_chunk $ set(error = true)”之前,文档根本不会编织(错误消息说找不到对象);现在它编织了,但我会收到错误消息“ .external2中的##错误(c_dataviewer,x,title):无法启动数据查看器“当我尝试查看我创建的(我创建的数据帧我显示的数据框架)时在全球环境中,但不在我的文件路径目录中,即 /云 /项目)。我猜那个rmarkdown找不到它们,因为它们处于不同的文件路径中?我还假设全球目录中的文件无法用于编织,那么我该如何使它们可以用于编织呢?谢谢你!

I'm using RStudio Cloud. I'm running an RMarkdown doc, when I run the code chunks in the doc they work fine, but when I'm trying to knit I get errors. Before I used the code "knitr::opts_chunk$set(error = TRUE)" the doc wouldn't knit at all (error message was saying objects couldn't be found); now it knits BUT I get the error message "## Error in .External2(C_dataviewer, x, title): unable to start data viewer" when I try to View(dataframes) that I've created (the data frames I created show up in the global environment but not in my file path directory, which is /cloud/project). I'm guessing that RMarkdown can't find these since they are in a different file path? I'm also assuming that files in the global directory aren't available for RMarkdown to knit, so how do I get them to be available for RMarkdown to knit? Thank you!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

画离情绘悲伤 2025-02-20 08:31:28

您可以做到这一点,而不是这样做。

```{r}
df # assuming df is your data.frame object name
```

这将在编织文档中打印您的整个数据框df

Instead of doing View you can just do this.

```{r}
df # assuming df is your data.frame object name
```

this will print your whole dataframe df in the knitted document.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文