I have the following ggplot element stored as text:
eval(parse(text = " annotate('text', as.Date('2013-12-31'), 30.31049879 * 1.02,
label = paste0( 19.48 , percent( 0.055 )), color = 'Blue') +
annotate('text', as.Date('2013-12-31'), 33.341548669 * 1.02,
label = paste0( 21.43 , percent( 0.048 )), color = 'Blue') "))
eval() returns error "non-numeric argument to binary operator" since it's trying to add the two parts together, but the plus sign is used differently with ggplot. Is there any way to dodge this problem?
parsefunction for? Since you are hard coding everything, would it not be easier to just have theannotate()simply. - Jrakru56data.frameorlistto hold yourx,yand 'label- Jrakru56dt<- mtcars; ggplot(data=dt) + geom_point(aes(x=mpg, y =hp )) + geom_text(aes(label = rownames(dt), x =mpg, y = hp))- Jrakru56