简体   繁体   English

无法从R Markdown中的Amelia包中加载“自由贸易”数据

[英]Can't load “freetrade” data from Amelia package in R Markdown

I am using R Markdown to generate a report. 我正在使用R Markdown生成报告。

I have a markdown chunk as : 我有一个markdown块:

```{r}
library(Amelia)
df <- freetrade
```

When I proceed to knit the document, I get the following error: 当我继续编织文档时,出现以下错误:

Error in eval(expr, envir, enclos) : object 'freetrade' not found
Calls: <Anonymous> ... handle -> withCallingHandlers -> withVisible -> eval -> eval
Execution halted

The same commands work well in R Studio's console. 相同的命令在R Studio的控制台中效果很好。 So I think it should load without any issues. 因此,我认为它应该加载没有任何问题。

How can I resolve this? 我该如何解决?

I apologize if this is a repeated question. 如果这是一个重复的问题,我深表歉意。

Okay, I figured it out using this question . 好的,我用这个问题弄清楚了。

I had to do the following steps: 我必须执行以下步骤:

```{r}
library(Amelia)
data("freetrade", package="Amelia") # load the data using data command
df <- freetrade
```

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM