I have encountered a problem with an old script using direct.label but it seems more than just an out-of-date script.
I tried to run the gqplot example from the directlabels manual and it did not work. The lattice example did and I have no idea what the error message is trying to tell me.
Error in switch(geom, density = "top.bumptwice", line = { :
EXPR must be a length 1 vector
If I try using geom_dl example from the manual I get a different error message but I am still clueless.
Error in eval(expr, envir, enclos) : could not find function "eval"
I updated all packages last week IIRC so I was wondering if I have an incompatibility?
Toy example:
mdat1 <- structure(list(tmonth = c(4L, 5L, 6L, 7L, 8L, 9L, 10L, 4L, 5L,
6L, 7L, 8L, 9L, 10L, 4L, 5L, 6L, 7L, 8L, 9L, 10L), variable = structure(c(1L,
1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L,
3L, 3L, 3L, 3L), .Label = c("nsw", "qld", "vic"), class = "factor"),
value = c(2L, 6L, 5L, 2L, 1L, 5L, 6L, 6L, 5L, 8L, 4L, 6L,
5L, 4L, 9L, 2L, 4L, 6L, 8L, 7L, 5L)), row.names = c(NA, -21L
), .Names = c("tmonth", "variable", "value"), class = "data.frame")
library(ggplot2)
library(reshape2)
library(directlabels)
p <- ggplot(mdat1, aes(tmonth, value, colour = variable)) + geom_line()
print(direct.label(p))
sessionInfo()
R version 3.2.3 (2015-12-10)
Platform: i686-pc-linux-gnu (32-bit)
Running under: Ubuntu 14.04.3 LTS
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] grid stats graphics grDevices utils datasets methods
[8] base
other attached packages:
[1] reshape2_1.4.1 directlabels_2013.6.15 quadprog_1.5-5
[4] ggplot2_2.0.0
loaded via a namespace (and not attached):
[1] labeling_0.3 colorspace_1.2-6 scales_0.3.0 magrittr_1.5
[5] plyr_1.8.3.9000 tools_3.2.3 gtable_0.1.2 Rcpp_0.12.2
[9] stringi_1.0-1 digest_0.6.8 stringr_1.0.0 munsell_0.4.2