我只是尝试使用R读取CSV文件并使用ggplot创建散点图。我在使用不同的文件之前没有遇到任何问题,但是这个当前的问题给我带来了问题
我正在做的就是输入以下命令:
dat<-read.csv("IV.csv")
head(dat)
a b
1 -80.2502 -1.24274
2 -80.2034 -1.27208
3 -80.1567 -1.06815
4 -80.1100 -1.33416
5 -80.0165 -1.67727
6 -79.9698 -1.32458
ggplot(dat, aes=(x=a,y=b)) + geom_point(shape=1)
Error: unexpected ',' in "ggplot(dat, aes=(x=a,"
发生了什么事?
答案 0 :(得分:7)
您遇到语法错误:
在=
aes
符号
这
ggplot(dat, aes=(x=a,y=b)) + geom_point(shape=1)
到
ggplot(dat, aes(x=a,y=b)) + geom_point(shape=1)