【发布时间】:2016-09-22 01:48:34
【问题描述】:
我是 R 工作室的新手,我的教授给了我们无法编写的代码。我不知道如何解决它。有人可以解释错误消息的含义以及如何解决吗?
我的代码:
```{r}
PlotSpecies <- function(s, title="Species") {
s.table <- table(s)
par(las=2)
barplot(s.table, names.arg=names(s.table),
horiz=TRUE, cex.names=0.5, main=title)
}
```
Error message: Error in parse(text + x, srcfile = src):
<text>:11:24: unexpected symbol 10: EW <- rep(species, endemic.woodland) 11: PlotSpecies(EW, title="Endemic ^ Calls:
<Anonymous> ... evaluate -> parse_all -> parse_all.character -> parse Execution halted
【问题讨论】:
-
您的代码是否在 knitr 之外运行?
-
错误信息和你的代码不匹配。