在 geom_label 中解析:丰富显示对象时出错:解析错误 (text = text[[i]])=
parse in geom_label : ERROR while rich displaying an object: Error in parse(text = text[[i]])=
我使用 ggplot
打印 geom_label
,代码如下:
ggplot()+
geom_label(aes( x = 10, y = 0.545, label = " expression 1 = p-value = 9.19 e-09 ; CI : [0.00, 0.00]"),
label.size = NA , hjust =0.08, size = 3.5, family = "Helvetica")
和我正在尝试以斜体.
打印p
所以我试过了
ggplot()+
geom_label(aes( x = 10, y = 0.545, label = " expression 1 = p-value = 9.19 e-09 ; CI : [0.00, 0.00]"),
label.size = NA , hjust =0.08, size = 3.5, family = "Helvetica")+
geom_label(aes( x = 10, y = 0.509, label = paste("expression 2 = italic(p)-value = 9.19 e-09 ; CI : [0.00, 0.00]")),
label.size = NA, hjust =0.08, size = 3.5, family = "Helvetica", parse = T)
哪个 return 我是以下错误信息:
ERROR while rich displaying an object: Error in parse(text =
text[[i]]): :1:19: unexpected string constant 1: 'expression 1 :
' 'italic(p)'
你知道错误从何而来以及如何解决吗?
PS : 基于此 post Unexpected symbol error in parse(text = str) with hyphen after a digit,
我也试过
ggplot()+
geom_label(aes( x = 10, y = 0.545, label = " expression 1 = p-value = 9.19 e-09 ; CI : [0.00, 0.00]"),
label.size = NA , hjust =0.08, size = 3.5, family = "Helvetica")+
geom_label(aes( x = 10, y = 0.509, label = paste("'expression 2 = italic(p)-value = 9.19 e-09 ; CI : [0.00, 0.00]'")),
label.size = NA, hjust =0.08, size = 3.5, family = "Helvetica", parse = T)
哪个有效,但 return 是我这个
学习help("plotmath")
.
library(ggplot2)
ggplot()+
geom_label(aes(x = 10, y = 0.545,
label = " expression 1 = p-value = 9.19 e-09 ; CI : [0.00, 0.00]"),
label.size = NA , hjust =0.08, size = 3.5)+
geom_label(aes(x = 10, y = 0.509,
label = paste("'expression 2 = ' * italic(p) * '-value = 9.19 e-09 ; CI : [0.00, 0.00]'")),
label.size = NA, hjust =0.08, size = 3.5, parse = T)
我已经删除了 family = "Helvetica"
,因为它在我的系统上引起了警告。
我使用 ggplot
打印 geom_label
,代码如下:
ggplot()+
geom_label(aes( x = 10, y = 0.545, label = " expression 1 = p-value = 9.19 e-09 ; CI : [0.00, 0.00]"),
label.size = NA , hjust =0.08, size = 3.5, family = "Helvetica")
和我正在尝试以斜体.
打印p
所以我试过了
ggplot()+
geom_label(aes( x = 10, y = 0.545, label = " expression 1 = p-value = 9.19 e-09 ; CI : [0.00, 0.00]"),
label.size = NA , hjust =0.08, size = 3.5, family = "Helvetica")+
geom_label(aes( x = 10, y = 0.509, label = paste("expression 2 = italic(p)-value = 9.19 e-09 ; CI : [0.00, 0.00]")),
label.size = NA, hjust =0.08, size = 3.5, family = "Helvetica", parse = T)
哪个 return 我是以下错误信息:
ERROR while rich displaying an object: Error in parse(text = text[[i]]): :1:19: unexpected string constant 1: 'expression 1 : ' 'italic(p)'
你知道错误从何而来以及如何解决吗?
PS : 基于此 post Unexpected symbol error in parse(text = str) with hyphen after a digit, 我也试过
ggplot()+
geom_label(aes( x = 10, y = 0.545, label = " expression 1 = p-value = 9.19 e-09 ; CI : [0.00, 0.00]"),
label.size = NA , hjust =0.08, size = 3.5, family = "Helvetica")+
geom_label(aes( x = 10, y = 0.509, label = paste("'expression 2 = italic(p)-value = 9.19 e-09 ; CI : [0.00, 0.00]'")),
label.size = NA, hjust =0.08, size = 3.5, family = "Helvetica", parse = T)
哪个有效,但 return 是我这个
学习help("plotmath")
.
library(ggplot2)
ggplot()+
geom_label(aes(x = 10, y = 0.545,
label = " expression 1 = p-value = 9.19 e-09 ; CI : [0.00, 0.00]"),
label.size = NA , hjust =0.08, size = 3.5)+
geom_label(aes(x = 10, y = 0.509,
label = paste("'expression 2 = ' * italic(p) * '-value = 9.19 e-09 ; CI : [0.00, 0.00]'")),
label.size = NA, hjust =0.08, size = 3.5, parse = T)
我已经删除了 family = "Helvetica"
,因为它在我的系统上引起了警告。