我正在尝试使用以下代码行在 R 中编写表图例:
legend("bottomright", inset=c(0,-0.7), c("valley", "ridge"), pch=c(2,17) col=c("red", "blue"), bty="n", xpd=TRUE)
我不断收到此错误代码:
Error: unexpected symbol in "legend("bottomright", inset=c(0,-0.7), c("valley", "ridge"), pch=c(2,17) col"
我已经尝试修复我的代码行,但此时我不确定问题是什么。任何和所有的帮助将不胜感激!谢谢!
您在pch=c(2,17),
后缺少逗号