Giulio Genovese
Giulio Genovese

Reputation: 2841

Inconsistency when parsing text with geom_text

The following piece of code:

library(ggplot2)
df<-data.frame(x=1:4,y=c(1,2,1,2),z=c('.00019','.00020','.00021','2.2 %*% 10^-5'))
ggplot(df,aes(x=x,y=y,label=z))+geom_text(parse=TRUE)

Will generate the following figure: enter image description here

How do I avoid converting the string '.00020' to '2e-04'?

Upvotes: 2

Views: 101

Answers (1)

baptiste
baptiste

Reputation: 77096

try this :

options(scipen=10)

Upvotes: 3

Related Questions