楼主: grit1990
4363 7

[问答] R 安装完成ggplot2后,运行报错,怎么解?? [推广有奖]

  • 1关注
  • 0粉丝

大专生

60%

还不是VIP/贵宾

-

威望
0
论坛币
8 个
通用积分
0.0600
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
458 点
帖子
32
精华
0
在线时间
68 小时
注册时间
2014-5-16
最后登录
2021-11-16

楼主
grit1990 发表于 2015-3-22 16:52:54 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
R语言,安装完成ggplot2后运行报错:”> library(ggplot2)Warning message:
程辑包‘ggplot2’是用R版本3.1.3 来建造的 “


请问怎么解?

网上有说用3.13之前的版本,可官网上已经将旧版本的R取消下载了

急求解答,谢谢![em23][em23]
二维码

扫码加我 拉你入群

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

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

关键词:ggplot2 gplot 运行报错 plot GPL message library 网上

沙发
呵呵哼哼哈哈 发表于 2015-3-22 16:56:27
warning 没关系的

藤椅
fssdlyl001 发表于 2015-3-22 17:25:14
这没有问题,可以用

板凳
grit1990 发表于 2015-3-22 18:02:55
fssdlyl001 发表于 2015-3-22 17:25
这没有问题,可以用
执行这个语句:
library(ggplot2)
OR<-c(.508, .734, .418, .674, .610, .694, .567, .214)
lower<-c(.340, .587, .275, .363, .475, .386, .348, .031)
upper<-c(.759, .919, .636, 1.252, .784, 1.248, .925, 1.478)
type<-c(1,1)
odds<-data.frame(OR, lower, upper,type)
vars<-c("Hypertension(+)","Hypertension(-)","obesity(+)","obesity(-)", "Dyslipidemia(+)","Dyslipidemia(-)","central obesity(+)","central obesity(-)")
ticks<-c(seq(.1, 1, by =.1), seq(0, 10, by =1), seq(10, 100, by =10))
a1<-ggplot(odds, aes(y= OR, x = vars)) +scale_y_log10()
a3<-a2+geom_errorbar(aes(ymin=lower, ymax=upper), width=.1,lwd=1)
a4<-a3+geom_hline(yintercept = 1, linetype=2)
a5<-a4+coord_flip()+ facet_wrap(~type,nrow=2)
a6<-a5+labs(title = "", x = "", y = "Odds ratio for DM")
a7<-a6+theme_bw()

提示:    Error: object 'a2' not found

报纸
grit1990 发表于 2015-3-22 18:07:45
呵呵哼哼哈哈 发表于 2015-3-22 16:56
warning 没关系的
可执行这个语句:
library(ggplot2)
OR<-c(.508, .734, .418, .674, .610, .694, .567, .214)
lower<-c(.340, .587, .275, .363, .475, .386, .348, .031)
upper<-c(.759, .919, .636, 1.252, .784, 1.248, .925, 1.478)
type<-c(1,1)
odds<-data.frame(OR, lower, upper,type)
vars<-c("Hypertension(+)","Hypertension(-)","obesity(+)","obesity(-)", "Dyslipidemia(+)","Dyslipidemia(-)","central obesity(+)","central obesity(-)")
ticks<-c(seq(.1, 1, by =.1), seq(0, 10, by =1), seq(10, 100, by =10))
a1<-ggplot(odds, aes(y= OR, x = vars)) +scale_y_log10()
a3<-a2+geom_errorbar(aes(ymin=lower, ymax=upper), width=.1,lwd=1)
a4<-a3+geom_hline(yintercept = 1, linetype=2)
a5<-a4+coord_flip()+ facet_wrap(~type,nrow=2)
a6<-a5+labs(title = "", x = "", y = "Odds ratio for DM")
a7<-a6+theme_bw()

提示:    Error: object 'a2' not found

地板
grit1990 发表于 2015-3-22 18:07:47
呵呵哼哼哈哈 发表于 2015-3-22 16:56
warning 没关系的
可执行这个语句:
library(ggplot2)
OR<-c(.508, .734, .418, .674, .610, .694, .567, .214)
lower<-c(.340, .587, .275, .363, .475, .386, .348, .031)
upper<-c(.759, .919, .636, 1.252, .784, 1.248, .925, 1.478)
type<-c(1,1)
odds<-data.frame(OR, lower, upper,type)
vars<-c("Hypertension(+)","Hypertension(-)","obesity(+)","obesity(-)", "Dyslipidemia(+)","Dyslipidemia(-)","central obesity(+)","central obesity(-)")
ticks<-c(seq(.1, 1, by =.1), seq(0, 10, by =1), seq(10, 100, by =10))
a1<-ggplot(odds, aes(y= OR, x = vars)) +scale_y_log10()
a3<-a2+geom_errorbar(aes(ymin=lower, ymax=upper), width=.1,lwd=1)
a4<-a3+geom_hline(yintercept = 1, linetype=2)
a5<-a4+coord_flip()+ facet_wrap(~type,nrow=2)
a6<-a5+labs(title = "", x = "", y = "Odds ratio for DM")
a7<-a6+theme_bw()

提示:    Error: object 'a2' not found

7
呵呵哼哼哈哈 发表于 2015-3-22 19:13:02
grit1990 发表于 2015-3-22 18:07
可执行这个语句:
library(ggplot2)
OR
你没定义a2啊

8
harleych 发表于 2015-3-23 09:22:11
目前最新的R正式版就是3.1.3。这个错误的原因确实是没有定义a2.

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

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