Hello,
I am using the round function (as shown below) for gem_text. In the ggplot2 chart, the text is printed as 24 for "round (24.0,1)". Could anyone please let me know what I am doing wrong here?
####################
geom_text (aes(label=round(est,1)), position=position_dodge(width=0.9),
################
I have tested the code in a separate R session. I don't understand why the round function of the same number (in this case it is 24.0) give somewhat different results depending on the length of the vector (1-element vs. 2-element vector)? Please see below.
############
x <- print (round(24.0,1))
[1] 24
y <- print (round (c(24.0, 24.1),1))
[1] 24.0 24.1
#############
Thanks,
Pradip Muhuri