wilkelab / ggtext

Improved text rendering support for ggplot2
https://wilkelab.org/ggtext/
GNU General Public License v2.0
655 stars 37 forks source link

'repair' must be a character vector of length 1 #15

Closed ghost closed 4 years ago

ghost commented 4 years ago

As per issue 13, I installed ggplot2 via remotes::install_github("tidyverse/ggplot2"). Solved the "Error in (angle %||#...) issue, but leads to a new one involving "repair" Error: repair must be a character vector of length 1. I'll attach the rlang::last_error and rlang::last_trace, and the sessionInfo below

Backtrace:

  1. (function (x, ...) ...
  2. ggplot2:::print.ggplot(x)
  3. ggplot2:::ggplot_build.ggplot(x)
  4. ggplot2:::by_layer(function(l, d) l$compute_aesthetics(d, plot))
  5. ggplot2:::f(l = layers[[i]], d = data[[i]])
  6. l$compute_aesthetics(d, plot)
  7. ggplot2:::f(..., self = self)
  8. ggplot2:::as_gg_data_frame(evaled)
    1. tibble:::as_tibble.list(x)
    2. tibble:::lst_to_tibble(x, .rows, .name_repair, col_lengths(x))
    3. tibble:::set_repaired_names(x, .name_repair)
    4. tibble:::repaired_names(...)
    5. vctrs::vec_as_names(name, repair = .name_repair, quiet = quiet)
    6. vctrs:::validate_repair(repair)
    7. rlang::arg_match(repair)

repair must be a character vector of length 1. Backtrace: █

  1. ├─(function (x, ...) ...
  2. └─ggplot2:::print.ggplot(x)
  3. ├─ggplot2::ggplot_build(x)
  4. └─ggplot2:::ggplot_build.ggplot(x)
  5. └─ggplot2:::by_layer(function(l, d) l$compute_aesthetics(d, plot))
  6. └─ggplot2:::f(l = layers[[i]], d = data[[i]])
  7. └─l$compute_aesthetics(d, plot)
  8. └─ggplot2:::f(..., self = self)
  9. └─ggplot2:::as_gg_data_frame(evaled)
    1. ├─ggplot2:::new_data_frame(tibble::as_tibble(x))
    2. ├─tibble::as_tibble(x)
    3. └─tibble:::as_tibble.list(x)
    4. └─tibble:::lst_to_tibble(x, .rows, .name_repair, col_lengths(x))
    5. └─tibble:::set_repaired_names(x, .name_repair)
    6. ├─rlang::set_names(...)
    7. │ └─rlang:::set_names_impl(x, x, nm, ...)
    8. │ └─rlang::is_function(nm)
    9. │ └─rlang::is_closure(x)
    10. └─tibble:::repaired_names(...)
    11. ├─tibble:::subclass_name_repair_errors(...)
    12. │ ├─base::tryCatch(...)
    13. │ │ └─base:::tryCatchList(expr, classes, parentenv, handlers)
    14. │ │ ├─base:::tryCatchOne(...)
    15. │ │ │ └─base:::doTryCatch(return(expr), name, parentenv, handler)
    16. │ │ └─base:::tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
    17. │ │ ├─base:::tryCatchOne(...)
    18. │ │ │ └─base:::doTryCatch(return(expr), name, parentenv, handler)
    19. │ │ └─base:::tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
    20. │ │ └─base:::tryCatchOne(expr, names, parentenv, handlers[[1L]])
    21. │ │ └─base:::doTryCatch(return(expr), name, parentenv, handler)
    22. │ └─base::force(expr)
    23. └─vctrs::vec_as_names(name, repair = .name_repair, quiet = quiet)
    24. └─vctrs:::validate_repair(repair)
    25. └─rlang::arg_match(repair)

repair must be a character vector of length 1. Backtrace: █

  1. ├─(function (x, ...) ...
  2. └─ggplot2:::print.ggplot(x)
  3. ├─ggplot2::ggplot_build(x)
  4. └─ggplot2:::ggplot_build.ggplot(x)
  5. └─ggplot2:::by_layer(function(l, d) l$compute_aesthetics(d, plot))
  6. └─ggplot2:::f(l = layers[[i]], d = data[[i]])
  7. └─l$compute_aesthetics(d, plot)
  8. └─ggplot2:::f(..., self = self)
  9. └─ggplot2:::as_gg_data_frame(evaled)
    1. ├─ggplot2:::new_data_frame(tibble::as_tibble(x))
    2. ├─tibble::as_tibble(x)
    3. └─tibble:::as_tibble.list(x)
    4. └─tibble:::lst_to_tibble(x, .rows, .name_repair, col_lengths(x))
    5. └─tibble:::set_repaired_names(x, .name_repair)
    6. ├─rlang::set_names(...)
    7. │ └─rlang:::set_names_impl(x, x, nm, ...)
    8. │ └─rlang::is_function(nm)
    9. │ └─rlang::is_closure(x)
    10. └─tibble:::repaired_names(...)
    11. ├─tibble:::subclass_name_repair_errors(...)
    12. │ ├─base::tryCatch(...)
    13. │ │ └─base:::tryCatchList(expr, classes, parentenv, handlers)
    14. │ │ ├─base:::tryCatchOne(...)
    15. │ │ │ └─base:::doTryCatch(return(expr), name, parentenv, handler)
    16. │ │ └─base:::tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
    17. │ │ ├─base:::tryCatchOne(...)
    18. │ │ │ └─base:::doTryCatch(return(expr), name, parentenv, handler)
    19. │ │ └─base:::tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
    20. │ │ └─base:::tryCatchOne(expr, names, parentenv, handlers[[1L]])
    21. │ │ └─base:::doTryCatch(return(expr), name, parentenv, handler)
    22. │ └─base::force(expr)
    23. └─vctrs::vec_as_names(name, repair = .name_repair, quiet = quiet)
    24. └─vctrs:::validate_repair(repair)
    25. └─rlang::arg_match(repair)
ghost commented 4 years ago

Sorry -- accidentally pasted the last_trace twice and failed to paste the sessionInfo

R version 3.6.2 (2019-12-12) Platform: x86_64-apple-darwin15.6.0 (64-bit) Running under: macOS Mojave 10.14.6

Matrix products: default BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib

locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages: [1] stats graphics grDevices utils datasets methods
[7] base

other attached packages: [1] ggtext_0.1.0 ggplot2_3.3.0.9000

loaded via a namespace (and not attached): [1] Rcpp_1.0.3 rstudioapi_0.10 xml2_1.2.2
[4] knitr_1.23 lobstr_1.1.1 magrittr_1.5
[7] gridtext_0.1.0 tidyselect_1.0.0.9000 munsell_0.5.0
[10] colorspace_1.4-1 R6_2.4.1 rlang_0.4.4.9000
[13] dplyr_0.8.99.9000 tools_3.6.2 grid_3.6.2
[16] gtable_0.3.0 xfun_0.8 withr_2.1.2
[19] htmltools_0.4.0 yaml_2.2.0 digest_0.6.23
[22] tibble_2.99.99.9014 lifecycle_0.1.0 crayon_1.3.4
[25] purrr_0.3.3 vctrs_0.2.99.9005 zeallot_0.1.0
[28] glue_1.3.1 evaluate_0.14 rmarkdown_1.17
[31] compiler_3.6.2 pillar_1.4.3.9000 scales_1.1.0
[34] pkgconfig_2.0.3

clauswilke commented 4 years ago

Two comments:

  1. Please provide a reproducible example.
  2. You're running development versions of tibble and vctrs, and those contain the last set of functions in the backtrace, so chances are the problem lives there.
ghost commented 4 years ago

I was running the example in issue 13 -- sorry I wasn't explicit. I installed the CRAN version of tibble and vctrs. Now works perfectly. Thanks!