tests/unattached.R

if(require(ggplot2)){
  if("package:directlabels" %in% search()){
    detach("package:directlabels")
  }
  no.labels <- ggplot(iris, aes(Petal.Length, Petal.Width, color=Species))+
    geom_point()
  with.labels <- no.labels+
    directlabels::geom_dl(aes(label=Species), method="smart.grid")
  print(with.labels)
  detach("package:ggplot2")
  directlabels::direct.label(no.labels, "smart.grid")
}

Try the directlabels package in your browser

Any scripts or data that you put into this service are public.

directlabels documentation built on May 29, 2024, 6:59 a.m.