我是R工作室的新手,我的教授給了我們不可編程的代碼。我不知道如何解決它。有人可以請解釋錯誤信息的含義以及我如何解決它?我的代碼不會在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之外運行? – SymbolixAU
錯誤消息和您的代碼不匹配。 – Roland