fsolt / dotwhisker

Dot-and-Whisker Plots of Regression Results
https://fsolt.org/dotwhisker/
Other
60 stars 10 forks source link

Failure with dev version of gtable #45

Closed hadley closed 8 years ago

hadley commented 8 years ago
checking examples ... ERROR
Running examples in ‘dotwhisker-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: add_brackets
> ### Title: Add Labelled Brackets to Group Predictors in a Dot-and-Whisker
> ###   Plot
> ### Aliases: add_brackets
> 
> ### ** Examples
> 
> library(broom)
> library(dplyr)

Attaching package: ‘dplyr’

The following objects are masked from ‘package:stats’:

    filter, lag

The following objects are masked from ‘package:base’:

    intersect, setdiff, setequal, union

> 
> data(mtcars)
> m1 <- lm(mpg ~ wt + cyl + disp, data = mtcars)
> m1_df <- broom::tidy(m1) # create data.frame of regression results
> 
> p <- dwplot(m1_df) +
+     scale_y_discrete(breaks = 4:1, labels=c("Intercept", "Weight", "Cylinders", "Displacement")) +
+     theme_bw() + xlab("Coefficient") + ylab("") +
+     geom_vline(xintercept = 0, colour = "grey50", linetype = 2) +
+     theme(legend.position="none")
Scale for 'y' is already present. Adding another scale for 'y', which will
replace the existing scale.
> 
> two_brackets <- list(c("Engine", "cyl", "disp"), c("Not Engine", "(Intercept)", "wt"))
> 
> g <- p %>% add_brackets(two_brackets)
> 
> grid.draw(g)  # to display
Error: could not find function "grid.draw"
Execution halted

checking re-building of vignette outputs ... NOTE
Error in re-building vignettes:
  ...
Loading required package: sandwich
Loading required package: lmtest
Loading required package: zoo

Attaching package: 'zoo'

The following objects are masked from 'package:base':

    as.Date, as.Date.numeric

Loading required package: MASS

Attaching package: 'MASS'

The following object is masked from 'package:dplyr':

    select

Loading required package: betareg
Scale for 'y' is already present. Adding another scale for 'y', which
will replace the existing scale.
Quitting from lines 168-210 (dotwhisker-vignette.Rmd) 
Error: processing vignette 'dotwhisker-vignette.Rmd' failed with diagnostics:
could not find function "grid.draw"
Execution halted

Probably because gtable now imports grid, rather than depending on it. I'm going to release ggplot2 + scales + gtable to CRAN on Feb 26, so can you please fix before then?

sammo3182 commented 8 years ago

Thank you for pointing out the error, Hadley. The error is fixed in c9f9882.