Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

no more geom_label( ) in ggplot2 1.01?

Tags:

r

ggplot2

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()

enter image description here

like image 869
GL_Li Avatar asked Dec 11 '15 13:12

GL_Li


1 Answers

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).

like image 132
Roland Avatar answered Oct 08 '22 22:10

Roland