I was following this ggplot2 docs try to reproduce text labels with geom_label
. But I got an error message,
"could not find function geom_label"
. ?geom_label
also says no such function. I checked on another two computers and got the same error message. All are with R 3.22, in RStudio 0.99.489 or in pure R command. ggplot2
is version 1.01 installed with install.packages(ggplot2)
.I did not find a clue from Google. So it seems that geom_label
has been removed from the latest ggplot2 before any documentation can be made.
My question is: what is used to replace geom_label
, which produces nice text labels in a boxed background?
Here is the code from the ggplot2 docs that suppose to produce the figure below.
p <- ggplot(mtcars, aes(wt, mpg, label = rownames(mtcars)))
p + geom_label()
geom_label
was implemented on 2015-07-24. The current version on CRAN (1.0.1) was published on 2015-03-17. You'll need to install the development version from GitHub if you want to use geom_label
or wait until it is uploaded to CRAN (which might take a while).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With