Error: could not find function "opts"

11,311 views
Skip to first unread message

Simon Han

unread,
May 26, 2016, 9:44:28 AM5/26/16
to ggplot2
> library(ggplot2)
> facebookData <- read.delim("FacebookNarcissism.dat",  header = TRUE)
>
> graph <- ggplot(facebookData, aes(NPQC_R_Total, Rating))
> graph + geom_point() + opts(title = "geom_point()")
Error: could not find function "opts"

What's wrong?

Adriano Fantini

unread,
May 26, 2016, 9:46:35 AM5/26/16
to Simon Han, ggplot2
opts() has been deprecated a long time ago. Use theme() options.
For setting a title, use ggtitle()

--
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility
 
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2

---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Brandon Hurr

unread,
May 26, 2016, 9:48:23 AM5/26/16
to Simon Han, ggplot2
You are using very old ggplot2 code. opts() has long been deprecated. 

labs() is the easiest way to change plot labels:

--

Simon Han

unread,
May 26, 2016, 10:20:25 AM5/26/16
to ggplot2
labs() is working. Thanks.
Reply all
Reply to author
Forward
0 new messages