楼主: Blackxon
1908 12

[问答] 关于ggplot的问题 [推广有奖]

  • 0关注
  • 0粉丝

小学生

7%

还不是VIP/贵宾

-

威望
0
论坛币
1173 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
35 点
帖子
6
精华
0
在线时间
2 小时
注册时间
2015-4-1
最后登录
2019-4-13

楼主
Blackxon 发表于 2015-4-1 08:58:05 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
deta<-read.csv("statistic from BaiduBank.csv")head(deta)

##years real.interest.rate nominal.interest.rate   CPI Inflation.Rate     GDP
##1  1978               2.52                  3.24 100.7            0.7 3645.20
##2  1979               1.32                  3.78 102.0            2.0 4062.60
##3  1980              -2.16                  5.04 106.0            6.0 4545.62
##4  1981               2.98                  5.40 102.4            2.4 4891.56
##5  1982               3.75                  5.67 101.9            1.9 5323.35
##6  1983               4.23                  5.76 101.5            1.5 5962.65

ggplot(data=deta,mapping=aes(x=years,y=GDP))
Error: No layers in plot

这是为什么?

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:gplot plot GPL ETA

沙发
呵呵哼哼哈哈 发表于 2015-4-1 09:03:01
只是指定了数据,还没设置图层~~后面加句geom_point()

藤椅
Blackxon 发表于 2015-4-1 09:11:46
呵呵哼哼哈哈 发表于 2015-4-1 09:03
只是指定了数据,还没设置图层~~后面加句geom_point()
还是一样TT
ggplot(data=deta,mapping=aes(x=years,y=GDP),geom_point())
Error: No layers in plot

板凳
夏少锋 发表于 2015-4-1 10:23:06
Blackxon 发表于 2015-4-1 09:11
还是一样TT
ggplot(data=deta,mapping=aes(x=years,y=GDP),geom_point())
Error: No layers in plot
用+号而不是,号

报纸
呵呵哼哼哈哈 发表于 2015-4-1 10:35:07
夏少锋 发表于 2015-4-1 10:23
用+号而不是,号
ggplot(data=deta,mapping=aes(x=years,y=GDP))+geom_point()

地板
harleych 发表于 2015-4-1 10:43:32
这个是使用习惯的问题,示例都是一步步来操作的,对应这个可以定义为
d<- ggplot(data=deta,mapping=aes(x=years,y=GDP))
d+geom_point()
如果想换个颜色,可以再加上
d + geom_point(aes(colour = years))

7
Blackxon 发表于 2015-4-1 12:26:20
夏少锋 发表于 2015-4-1 10:23
用+号而不是,号
还是不行,Error in aes(x = years, y = GDP) + geom_point() :
  non-numeric argument to binary operator
用qplot就行,为什么?

8
Blackxon 发表于 2015-4-1 12:27:23
呵呵哼哼哈哈 发表于 2015-4-1 10:35
ggplot(data=deta,mapping=aes(x=years,y=GDP))+geom_point()
还是不行,Error in aes(x = years, y = GDP) + geom_point() :
  non-numeric argument to binary operator
用qplot就行,为什么?

9
夏少锋 发表于 2015-4-1 12:52:59
Blackxon 发表于 2015-4-1 12:27
还是不行,Error in aes(x = years, y = GDP) + geom_point() :
  non-numeric argument to binary ope ...
ggplot(data=deta,mapping=aes(x=years,y=GDP))+geom_point()

10
夏少锋 发表于 2015-4-1 12:53:54
Blackxon 发表于 2015-4-1 12:27
还是不行,Error in aes(x = years, y = GDP) + geom_point() :
  non-numeric argument to binary ope ...
其实看看ggplot的帮助文件一切ok

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-6 07:51