I want to add an R^2 value to my plot. I passed the label to geom_text() as follows;
geom_text(aes(x,y,label=caption),parse=T,
data.frame(x=-2,y=80,caption=("R^2=0.43"))))
but it plots as =(R^2,0.43). Any ideas?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You want your caption to be “R^2==0.43”. Look at the help page for
plotmath. There it shows that==gives you equals.EDIT:
To answer the comment after the question, you can use atop in the expression.
"atop(R^2==0.43,p==0.763)"This works for two lines, but not more.