strengejacke/sjmisc

Error when checking the package

iago-pssjd opened this issue · 3 comments

Hi Daniel,
I was checking the package after some update I did, but I got 2 errors. Then I just check your development master version and I also got (I think the same) 2 errors. I copy here the reprex for one of them:

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

mtcars %>%
  group_by(cyl) %>%
  dicho(disp, append = F) %>%
  table()
#> Error: No common type for `value` <factor<dec08>> and `x` <double>.


sessionInfo()
#> R version 3.6.1 (2019-07-05)
#> Platform: x86_64-w64-mingw32/x64 (64-bit)
#> Running under: Windows 10 x64 (build 17134)
#> 
#> Matrix products: default
#> 
#> locale:
#> [1] LC_COLLATE=Spanish_Spain.1252  LC_CTYPE=Spanish_Spain.1252   
#> [3] LC_MONETARY=Spanish_Spain.1252 LC_NUMERIC=C                  
#> [5] LC_TIME=Spanish_Spain.1252    
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> other attached packages:
#> [1] dplyr_0.8.3    sjmisc_2.8.2.1
#> 
#> loaded via a namespace (and not attached):
#>  [1] Rcpp_1.0.3          knitr_1.26          magrittr_1.5       
#>  [4] tidyselect_0.2.5    insight_0.7.1       R6_2.4.1           
#>  [7] rlang_0.4.2         stringr_1.4.0       highr_0.8          
#> [10] tools_3.6.1         xfun_0.11           htmltools_0.4.0    
#> [13] yaml_2.2.0          digest_0.6.23       assertthat_0.2.1   
#> [16] tibble_2.99.99.9010 crayon_1.3.4        purrr_0.3.3        
#> [19] vctrs_0.2.0.9007    sjlabelled_1.1.1.1  snakecase_0.11.0   
#> [22] glue_1.3.1          evaluate_0.14       rmarkdown_2.0      
#> [25] stringi_1.4.3       compiler_3.6.1      pillar_1.4.2.9001  
#> [28] pkgconfig_2.0.3

Created on 2019-12-20 by the reprex package (v0.3.0)

And, looking at the trace:

> rlang::last_trace()
<error/vctrs_error_incompatible_type>
No common type for `value` <factor<dec08>> and `x` <double>.
Backtrace:
     x
  1. +-mtcars %>% group_by(cyl) %>% dicho(disp, append = F) %>% table()
  2. | +-base::withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  3. | \-base::eval(quote(`_fseq`(`_lhs`)), env, env)
  4. |   \-base::eval(quote(`_fseq`(`_lhs`)), env, env)
  5. |     \-`_fseq`(`_lhs`)
  6. |       \-magrittr::freduce(value, `_function_list`)
  7. |         \-function_list[[i]](value)
  8. |           +-sjmisc::dicho(., disp, append = F)
  9. |           \-sjmisc:::dicho.default(., disp, append = F) R/dicho.R:95:2
 10. |             \-sjmisc:::recode_fun(...) R/dicho.R:111:2
 11. |               +-base::`[<-`(...) R/dicho.R:273:8
 12. |               \-tibble:::`[<-.tbl_df`(...) R/dicho.R:273:8
 13. |                 \-tibble:::tbl_subassign(x, i, j, value)
 14. |                   \-tibble:::tbl_subassign_row(x, i, value)
 15. |                     \-vctrs::`vec_slice<-`(`*tmp*`, i, value = value[[j]])
 16. +-vctrs:::vec_type2_dispatch(x = x, y = y, x_arg = x_arg, y_arg = y_arg)
 17. +-vctrs::vec_ptype2.factor(x = x, y = y, x_arg = x_arg, y_arg = y_arg)
 18. \-vctrs:::vec_ptype2.factor.default(...)
 19.   \-vctrs::vec_default_ptype2(x, y, x_arg = x_arg, y_arg = y_arg)
 20.     \-vctrs::stop_incompatible_type(x, y, x_arg = x_arg, y_arg = y_arg)
 21.       \-vctrs:::stop_incompatible(...)
 22.         \-vctrs:::stop_vctrs(...)

strange, just checked with the latest GitHub master from sjmisc, and works fine for me:

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

mtcars %>%
  group_by(cyl) %>%
  dicho(disp, append = F) %>%
  table()
#> .
#>  1  2 
#> 18 14

devtools::session_info()
#> - Session info ---------------------------------------------------------------
#>  setting  value                       
#>  version  R version 3.6.2 (2019-12-12)
#>  os       Windows 10 x64              
#>  system   x86_64, mingw32             
#>  ui       RTerm                       
#>  language (EN)                        
#>  collate  German_Germany.1252         
#>  ctype    German_Germany.1252         
#>  tz       Europe/Berlin               
#>  date     2019-12-20                  
#> 
#> - Packages -------------------------------------------------------------------
#>  package     * version date       lib source                                  
#>  assertthat    0.2.1   2019-03-21 [1] CRAN (R 3.6.0)                          
#>  backports     1.1.5   2019-10-02 [1] CRAN (R 3.6.1)                          
#>  callr         3.4.0   2019-12-09 [1] CRAN (R 3.6.1)                          
#>  cli           2.0.0   2019-12-09 [1] CRAN (R 3.6.1)                          
#>  crayon        1.3.4   2017-09-16 [1] CRAN (R 3.6.0)                          
#>  desc          1.2.0   2018-05-01 [1] CRAN (R 3.6.0)                          
#>  devtools      2.2.1   2019-09-24 [1] CRAN (R 3.6.1)                          
#>  digest        0.6.23  2019-11-23 [1] CRAN (R 3.6.1)                          
#>  dplyr       * 0.8.3   2019-07-04 [1] CRAN (R 3.6.1)                          
#>  ellipsis      0.3.0   2019-09-20 [1] CRAN (R 3.6.1)                          
#>  evaluate      0.14    2019-05-28 [1] CRAN (R 3.6.0)                          
#>  fansi         0.4.0   2018-10-05 [1] CRAN (R 3.6.0)                          
#>  fs            1.3.1   2019-05-06 [1] CRAN (R 3.6.0)                          
#>  glue          1.3.1   2019-03-12 [1] CRAN (R 3.6.0)                          
#>  highr         0.8     2019-03-20 [1] CRAN (R 3.6.0)                          
#>  htmltools     0.4.0   2019-10-04 [1] CRAN (R 3.6.1)                          
#>  insight       0.7.1.1 2019-12-20 [1] local                                   
#>  knitr         1.26    2019-11-12 [1] CRAN (R 3.6.1)                          
#>  magrittr      1.5     2014-11-22 [1] CRAN (R 3.6.0)                          
#>  memoise       1.1.0   2017-04-21 [1] CRAN (R 3.6.0)                          
#>  pillar        1.4.3   2019-12-20 [1] CRAN (R 3.6.2)                          
#>  pkgbuild      1.0.6   2019-10-09 [1] CRAN (R 3.6.1)                          
#>  pkgconfig     2.0.3   2019-09-22 [1] CRAN (R 3.6.1)                          
#>  pkgload       1.0.2   2018-10-29 [1] CRAN (R 3.6.0)                          
#>  prettyunits   1.0.2   2015-07-13 [1] CRAN (R 3.6.0)                          
#>  processx      3.4.1   2019-07-18 [1] CRAN (R 3.6.1)                          
#>  ps            1.3.0   2018-12-21 [1] CRAN (R 3.6.0)                          
#>  purrr         0.3.3   2019-10-18 [1] CRAN (R 3.6.1)                          
#>  R6            2.4.1   2019-11-12 [1] CRAN (R 3.6.1)                          
#>  Rcpp          1.0.3   2019-11-08 [1] CRAN (R 3.6.1)                          
#>  remotes       2.1.0   2019-06-24 [1] CRAN (R 3.6.0)                          
#>  rlang         0.4.2   2019-11-23 [1] CRAN (R 3.6.1)                          
#>  rmarkdown     2.0     2019-12-12 [1] CRAN (R 3.6.1)                          
#>  rprojroot     1.3-2   2018-01-03 [1] CRAN (R 3.6.0)                          
#>  sessioninfo   1.1.1   2018-11-05 [1] CRAN (R 3.6.0)                          
#>  sjlabelled    1.1.1.1 2019-12-19 [1] Github (strengejacke/sjlabelled@168daab)
#>  sjmisc      * 2.8.2.1 2019-12-20 [1] local                                   
#>  snakecase     0.11.0  2019-05-25 [1] CRAN (R 3.6.0)                          
#>  stringi       1.4.3   2019-03-12 [1] CRAN (R 3.6.0)                          
#>  stringr       1.4.0   2019-02-10 [1] CRAN (R 3.6.0)                          
#>  testthat      2.3.1   2019-12-01 [1] CRAN (R 3.6.1)                          
#>  tibble        2.1.3   2019-06-06 [1] CRAN (R 3.6.0)                          
#>  tidyselect    0.2.5   2018-10-11 [1] CRAN (R 3.6.0)                          
#>  usethis       1.5.1   2019-07-04 [1] CRAN (R 3.6.1)                          
#>  withr         2.1.2   2018-03-15 [1] CRAN (R 3.6.0)                          
#>  xfun          0.11    2019-11-12 [1] CRAN (R 3.6.1)                          
#>  yaml          2.2.0   2018-07-25 [1] CRAN (R 3.6.0)                          
#> 
#> [1] C:/Users/mail/Documents/R/win-library/3.6
#> [2] C:/Program Files/R/R-3.6.2/library

Created on 2019-12-20 by the reprex package (v0.3.0)

Thank you Daniel.

I have just updated my R and all my packages to their last versions and I get distinct errors. They seem to be related with the packages vctrs v2.1.0 and tidyselect, but I'm checking yet.

Sorry Daniel. It was due to that I had installed the development version of the tibble package.