Error When Running Tidymodel Example

Dear All,
I am making my baby steps with tidymodels. When I run the code pasted below (taken from

https://juliasilge.com/blog/food-hyperparameter-tune/

so, it does not get more reputable than this!).

I get an error

x Bootstrap01: internal: Error: $ operator is invalid for atomic vectors

Does anybody know what is going wrong?
I have also installed the dev version of tidymodels, but no avail.
I also paste below is my sessionInfo().
Any help is very appreciated!

sessionInfo()
R version 3.6.3 (2020-02-29)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 10 (buster)

Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/openblas/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/libopenblasp-r0.3.5.so

locale:
[1] LC_CTYPE=en_GB.utf8 LC_NUMERIC=C
[3] LC_TIME=en_GB.utf8 LC_COLLATE=en_GB.utf8
[5] LC_MONETARY=en_GB.utf8 LC_MESSAGES=en_GB.utf8
[7] LC_PAPER=en_GB.utf8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_GB.utf8 LC_IDENTIFICATION=C

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

other attached packages:
[1] ranger_0.12.1 doParallel_1.0.15 iterators_1.0.12
[4] foreach_1.5.0 yardstick_0.0.6 workflows_0.1.1
[7] tune_0.0.1 rsample_0.0.6 recipes_0.1.10
[10] parsnip_0.0.5 infer_0.5.1 dials_0.0.5
[13] scales_1.1.0 broom_0.5.5 tidymodels_0.1.0.9000
[16] GGally_1.5.0 janitor_1.2.1 countrycode_1.1.1
[19] forcats_0.5.0 stringr_1.4.0 dplyr_0.8.99.9002
[22] purrr_0.3.3 readr_1.3.1 tidyr_1.0.2
[25] tibble_3.0.0 ggplot2_3.3.0 tidyverse_1.3.0

loaded via a namespace (and not attached):
[1] readxl_1.3.1 backports_1.1.5 tidytext_0.2.3
[4] plyr_1.8.6 igraph_1.2.5 splines_3.6.3
[7] crosstalk_1.1.0.1 listenv_0.8.0 SnowballC_0.7.0
[10] rstantools_2.0.0 inline_0.3.15 digest_0.6.25
[13] htmltools_0.4.0 rsconnect_0.8.16 fansi_0.4.1
[16] magrittr_1.5 globals_0.12.5 modelr_0.1.6
[19] gower_0.2.1 matrixStats_0.56.0 xts_0.12-0
[22] hardhat_0.1.2 prettyunits_1.1.1 colorspace_1.4-1
[25] rvest_0.3.5 xfun_0.12 haven_2.2.0
[28] callr_3.4.3 crayon_1.3.4 jsonlite_1.6.1
[31] lme4_1.1-21 survival_3.1-8 zoo_1.8-7
[34] glue_1.3.2 gtable_0.3.0 ipred_0.9-9
[37] pkgbuild_1.0.6 rstan_2.19.3 DBI_1.1.0
[40] miniUI_0.1.1.1 Rcpp_1.0.4 xtable_1.8-4
[43] GPfit_1.0-8 stats4_3.6.3 lava_1.6.7
[46] StanHeaders_2.19.2 prodlim_2019.11.13 DT_0.13
[49] htmlwidgets_1.5.1 httr_1.4.1 threejs_0.3.3
[52] RColorBrewer_1.1-2 ellipsis_0.3.0 farver_2.0.3
[55] pkgconfig_2.0.3 reshape_0.8.8 loo_2.2.0
[58] nnet_7.3-12 dbplyr_1.4.2 utf8_1.1.4
[61] labeling_0.3 tidyselect_1.0.0 rlang_0.4.5.9000
[64] DiceDesign_1.8-1 reshape2_1.4.3 later_1.0.0
[67] munsell_0.5.0 cellranger_1.1.0 tools_3.6.3
[70] cli_2.0.2 generics_0.0.2 ggridges_0.5.2
[73] fastmap_1.0.1 knitr_1.28 processx_3.4.2
[76] fs_1.3.2 future_1.16.0 nlme_3.1-143
[79] mime_0.9 rstanarm_2.19.3 xml2_1.2.2
[82] tokenizers_0.2.1 compiler_3.6.3 bayesplot_1.7.1
[85] shinythemes_1.1.2 rstudioapi_0.11 curl_4.3
[88] reprex_0.3.0 tidyposterior_0.0.2 lhs_1.0.1
[91] stringi_1.4.6 ps_1.3.2 lattice_0.20-38
[94] Matrix_1.2-18 nloptr_1.2.2.1 markdown_1.1
[97] shinyjs_1.1 vctrs_0.2.99.9010 pillar_1.4.3
[100] lifecycle_0.2.0 furrr_0.1.0 httpuv_1.5.2
[103] R6_2.4.1 promises_1.1.0 gridExtra_2.3
[106] janeaustenr_0.1.5 codetools_0.2-16 boot_1.3-23
[109] colourpicker_1.0 MASS_7.3-51.4 gtools_3.8.2
[112] assertthat_0.2.1 withr_2.1.2 shinystan_2.5.0
[115] hms_0.5.3 grid_3.6.3 rpart_4.1-15
[118] timeDate_3043.102 class_7.3-15 minqa_1.2.4
[121] snakecase_0.11.0 pROC_1.16.2 tidypredict_0.4.5
[124] shiny_1.4.0.2 lubridate_1.7.4 base64enc_0.1-3
[127] dygraphs_1.1.1.6


library(tidyverse)
library(countrycode)
library(janitor)
library(GGally)
library(tidymodels)
library(doParallel)
library(ranger)

### read the raw data

food_consumption <- readr::read_csv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-02-18/food_consumption.csv")


### get the data in shape for mining. "asia" is now the column you want to predict 

food <- food_consumption %>%
  select(-co2_emmission) %>%
  pivot_wider(
    names_from = food_category,
    values_from = consumption
  ) %>%
  clean_names() %>%
  mutate(continent = countrycode(
    country,
    origin = "country.name",
    destination = "continent"
  )) %>%
  mutate(asia = case_when(
    continent == "Asia" ~ "Asia",
    TRUE ~ "Other"
  )) %>%
  select(-country, -continent) %>%
  mutate_if(is.character, factor)

gpl <- ggscatmat(food, columns = 1:11, color = "asia", alpha = 0.7)

ggsave( "matrix_plot.pdf", gpl, width=15, height=15)




set.seed(1234)
food_boot <- bootstraps(food, times = 30)



rf_spec <- rand_forest(
  mode = "classification",
  mtry = tune(),
  trees = 1000,
  min_n = tune()
) %>%
  set_engine("ranger")


## cl <- makeCluster(2)
## registerDoParallel(cl)



rf_grid <- tune_grid(
  asia ~ .,
  model = rf_spec,
  resamples = food_boot
)





## stopCluster(cl)


Seems like just a cut-and-paste problem. Try this:

library(tidyverse)
library(countrycode)
library(janitor)
#> 
#> Attaching package: 'janitor'
#> The following objects are masked from 'package:stats':
#> 
#>     chisq.test, fisher.test
library(GGally)
#> Registered S3 method overwritten by 'GGally':
#>   method from   
#>   +.gg   ggplot2
#> 
#> Attaching package: 'GGally'
#> The following object is masked from 'package:dplyr':
#> 
#>     nasa
library(tidymodels)
#> ── Attaching packages ────────────────────────────────────────── tidymodels 0.1.0 ──
#> ✓ broom     0.5.5      ✓ rsample   0.0.6 
#> ✓ dials     0.0.5      ✓ tune      0.0.1 
#> ✓ infer     0.5.1      ✓ workflows 0.1.1 
#> ✓ parsnip   0.0.5      ✓ yardstick 0.0.6 
#> ✓ recipes   0.1.10
#> ── Conflicts ───────────────────────────────────────────── tidymodels_conflicts() ──
#> x scales::discard() masks purrr::discard()
#> x dplyr::filter()   masks stats::filter()
#> x recipes::fixed()  masks stringr::fixed()
#> x dplyr::lag()      masks stats::lag()
#> x dials::margin()   masks ggplot2::margin()
#> x yardstick::spec() masks readr::spec()
#> x recipes::step()   masks stats::step()
library(doParallel)
#> Loading required package: foreach
#> 
#> Attaching package: 'foreach'
#> The following objects are masked from 'package:purrr':
#> 
#>     accumulate, when
#> Loading required package: iterators
#> Loading required package: parallel
library(ranger)

food_consumption <- readr::read_csv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-02-18/food_consumption.csv")
#> Parsed with column specification:
#> cols(
#>   country = col_character(),
#>   food_category = col_character(),
#>   consumption = col_double(),
#>   co2_emmission = col_double()
#> )

food <- food_consumption %>%
  select(-co2_emmission) %>%
  pivot_wider(
    names_from = food_category,
    values_from = consumption
  ) %>%
  clean_names() %>%
  mutate(continent = countrycode(
    country,
    origin = "country.name",
    destination = "continent"
  )) %>%
  mutate(asia = case_when(
    continent == "Asia" ~ "Asia",
    TRUE ~ "Other"
  )) %>%
  select(-country, -continent) %>%
  mutate_if(is.character, factor)

set.seed(1234)
food_boot <- bootstraps(food, times = 30)

rf_spec <- rand_forest(
  mode = "classification",
  mtry = tune(),
  trees = 1000,
  min_n = tune()
) %>%
  set_engine("ranger")

rf_spec
#> Random Forest Model Specification (classification)
#> 
#> Main Arguments:
#>   mtry = tune()
#>   trees = 1000
#>   min_n = tune()
#> 
#> Computational engine: ranger

doParallel::registerDoParallel()

rf_grid <- tune_grid(
  asia ~ .,
  model = rf_spec,
  resamples = food_boot
)
#> i Creating pre-processing data to finalize unknown parameter: mtry

rf_grid
#> # Bootstrap sampling 
#> # A tibble: 30 x 4
#>    splits           id          .metrics          .notes          
#>    <list>           <chr>       <list>            <list>          
#>  1 <split [130/48]> Bootstrap01 <tibble [20 × 5]> <tibble [0 × 1]>
#>  2 <split [130/49]> Bootstrap02 <tibble [20 × 5]> <tibble [0 × 1]>
#>  3 <split [130/49]> Bootstrap03 <tibble [20 × 5]> <tibble [0 × 1]>
#>  4 <split [130/51]> Bootstrap04 <tibble [20 × 5]> <tibble [0 × 1]>
#>  5 <split [130/47]> Bootstrap05 <tibble [20 × 5]> <tibble [0 × 1]>
#>  6 <split [130/51]> Bootstrap06 <tibble [20 × 5]> <tibble [0 × 1]>
#>  7 <split [130/57]> Bootstrap07 <tibble [20 × 5]> <tibble [0 × 1]>
#>  8 <split [130/51]> Bootstrap08 <tibble [20 × 5]> <tibble [0 × 1]>
#>  9 <split [130/44]> Bootstrap09 <tibble [20 × 5]> <tibble [0 × 1]>
#> 10 <split [130/53]> Bootstrap10 <tibble [20 × 5]> <tibble [0 × 1]>
#> # … with 20 more rows

rf_grid %>%
  collect_metrics()
#> # A tibble: 20 x 7
#>     mtry min_n .metric  .estimator  mean     n std_err
#>    <int> <int> <chr>    <chr>      <dbl> <int>   <dbl>
#>  1     2     4 accuracy binary     0.831    30 0.00768
#>  2     2     4 roc_auc  binary     0.844    30 0.00892
#>  3     2    12 accuracy binary     0.828    30 0.00778
#>  4     2    12 roc_auc  binary     0.836    30 0.00928
#>  5     4    33 accuracy binary     0.817    30 0.00810
#>  6     4    33 roc_auc  binary     0.821    30 0.0100 
#>  7     4    37 accuracy binary     0.816    30 0.00803
#>  8     4    37 roc_auc  binary     0.818    30 0.0104 
#>  9     5    31 accuracy binary     0.814    30 0.00899
#> 10     5    31 roc_auc  binary     0.822    30 0.0108 
#> 11     6     9 accuracy binary     0.824    30 0.00917
#> 12     6     9 roc_auc  binary     0.832    30 0.00946
#> 13     7    21 accuracy binary     0.817    30 0.00975
#> 14     7    21 roc_auc  binary     0.825    30 0.0102 
#> 15     8    18 accuracy binary     0.819    30 0.00939
#> 16     8    18 roc_auc  binary     0.825    30 0.0101 
#> 17     9    26 accuracy binary     0.813    30 0.00952
#> 18     9    26 roc_auc  binary     0.822    30 0.0106 
#> 19    11    15 accuracy binary     0.811    30 0.0111 
#> 20    11    15 roc_auc  binary     0.823    30 0.0107
  
rf_grid %>%
  show_best("roc_auc")
#> # A tibble: 5 x 7
#>    mtry min_n .metric .estimator  mean     n std_err
#>   <int> <int> <chr>   <chr>      <dbl> <int>   <dbl>
#> 1     2     4 roc_auc binary     0.844    30 0.00892
#> 2     2    12 roc_auc binary     0.836    30 0.00928
#> 3     6     9 roc_auc binary     0.832    30 0.00946
#> 4     7    21 roc_auc binary     0.825    30 0.0102 
#> 5     8    18 roc_auc binary     0.825    30 0.0101

Created on 2020-04-01 by the reprex package (v0.3.0)

Thanks, but I still get the same error. Even after pasting your commands one after the other.

I also tried on another linux box, but same result.

I should say I am using the dplyr development version, but I do not think it matters.

That error that you are getting:

internal: Error: $ operator is invalid for atomic vectors

is one that we have realized is not very helpful! In the new version of tune that just went to CRAN, we have fixed this so you should get a better error message in this situation.

I have most often seen this in the situation where classification models are given a non-factor outcome variable. Can you look at food carefully and see what the data type of asia is? Is it a factor?

1 Like

Thanks for the reply. I was aware of that fix (I googled the error message before posting), so I reinstalled the tidymodel package (development version) and the error remained.
What puzzles me is that asia is indeed a factor (see below) so the classification problem is correct.
I am banging my head against the wall; I do not know what else to add.

food$asia
[1] Other Other Other Other Other Other Other Other Other Asia Other Other
[13] Other Other Other Other Other Other Other Asia Other Asia Other Other
[25] Asia Other Other Asia Other Other Other Other Asia Other Other Other
[37] Other Other Other Other Other Other Other Other Other Other Other Asia
[49] Other Other Other Other Other Other Other Other Other Asia Asia Other
[61] Asia Other Other Asia Other Other Other Other Asia Other Asia Other
[73] Other Other Other Other Other Other Other Other Other Other Other Asia
[85] Asia Asia Other Other Other Asia Other Asia Other Other Other Other
[97] Asia Other Other Other Asia Asia Other Other Other Other Asia Other
[109] Asia Other Other Other Other Other Other Other Other Asia Other Other
[121] Other Asia Asia Other Asia Other Asia Asia Other Asia
Levels: Asia Other

I've cut-and-pasted the entire reprex since all the output is commented out. Here's my sessionInfo() from another successful run from a new session.

R version 3.6.3 (2020-02-29)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Catalina 10.15.3

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRblas.0.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] parallel  stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] ranger_0.12.1     doParallel_1.0.15 iterators_1.0.12  foreach_1.5.0     yardstick_0.0.6   workflows_0.1.1   tune_0.0.1       
 [8] rsample_0.0.6     recipes_0.1.10    parsnip_0.0.5     infer_0.5.1       dials_0.0.5       scales_1.1.0      broom_0.5.5      
[15] tidymodels_0.1.0  GGally_1.5.0      janitor_1.2.1     countrycode_1.1.1 forcats_0.5.0     stringr_1.4.0     dplyr_0.8.5      
[22] purrr_0.3.3       readr_1.3.1       tidyr_1.0.2       tibble_3.0.0      ggplot2_3.3.0     tidyverse_1.3.0  

loaded via a namespace (and not attached):
  [1] readxl_1.3.1         backports_1.1.5      tidytext_0.2.3       plyr_1.8.6           igraph_1.2.5         splines_3.6.3       
  [7] crosstalk_1.1.0.1    listenv_0.8.0        SnowballC_0.7.0      rstantools_2.0.0     inline_0.3.15        digest_0.6.25       
 [13] htmltools_0.4.0      rsconnect_0.8.16     fansi_0.4.1          magrittr_1.5         globals_0.12.5       modelr_0.1.6        
 [19] gower_0.2.1          matrixStats_0.56.0   xts_0.12-0           hardhat_0.1.2        prettyunits_1.1.1    colorspace_1.4-1    
 [25] rvest_0.3.5          xfun_0.12            haven_2.2.0          callr_3.4.3          crayon_1.3.4         jsonlite_1.6.1      
 [31] lme4_1.1-21          survival_3.1-11      zoo_1.8-7            glue_1.3.2           gtable_0.3.0         ipred_0.9-9         
 [37] pkgbuild_1.0.6       rstan_2.19.3         DBI_1.1.0            miniUI_0.1.1.1       Rcpp_1.0.4           xtable_1.8-4        
 [43] GPfit_1.0-8          stats4_3.6.3         lava_1.6.7           StanHeaders_2.21.0-1 prodlim_2019.11.13   DT_0.13             
 [49] htmlwidgets_1.5.1    httr_1.4.1           threejs_0.3.3        RColorBrewer_1.1-2   ellipsis_0.3.0       pkgconfig_2.0.3     
 [55] reshape_0.8.8        loo_2.2.0            nnet_7.3-13          dbplyr_1.4.2         utf8_1.1.4           tidyselect_1.0.0    
 [61] rlang_0.4.5          DiceDesign_1.8-1     reshape2_1.4.3       later_1.0.0          munsell_0.5.0        cellranger_1.1.0    
 [67] tools_3.6.3          cli_2.0.2            generics_0.0.2       ggridges_0.5.2       fastmap_1.0.1        knitr_1.28          
 [73] processx_3.4.2       fs_1.4.0             future_1.16.0        nlme_3.1-145         mime_0.9             rstanarm_2.19.3     
 [79] xml2_1.3.0           tokenizers_0.2.1     compiler_3.6.3       bayesplot_1.7.1      shinythemes_1.1.2    rstudioapi_0.11     
 [85] curl_4.3             reprex_0.3.0         tidyposterior_0.0.2  lhs_1.0.1            stringi_1.4.6        ps_1.3.2            
 [91] lattice_0.20-40      Matrix_1.2-18        nloptr_1.2.2.1       markdown_1.1         shinyjs_1.1          vctrs_0.2.4         
 [97] pillar_1.4.3         lifecycle_0.2.0      furrr_0.1.0          httpuv_1.5.2         R6_2.4.1             promises_1.1.0      
[103] gridExtra_2.3        janeaustenr_0.1.5    codetools_0.2-16     boot_1.3-24          colourpicker_1.0     MASS_7.3-51.5       
[109] gtools_3.8.2         assertthat_0.2.1     withr_2.1.2          shinystan_2.5.0      hms_0.5.3            grid_3.6.3          
[115] rpart_4.1-15         timeDate_3043.102    minqa_1.2.4          class_7.3-16         snakecase_0.11.0     pROC_1.16.2         
[121] tidypredict_0.4.5    shiny_1.4.0.2        lubridate_1.7.4      base64enc_0.1-3      dygraphs_1.1.1.6    
> 

That's a lot of versions that have to play nice.

The version of dials that you are using is brand new (on CRAN yesterday) and at about 9am this morning, I figured out that is has a bug. I'm fixing it now and will do an special CRAN submission for it.

If you can install version 0.0.4, it should be fine.

1 Like

Hello,
And thanks. Unfortunately even with dials 0.0.4 the error persists. Notice that technocrat can run the code even if he runs dials.0.0.5.
No idea of what else the problem could be. Can anyone else reproduce the bug?

I add a bit of info hopefully not misleading: after installing the development version of tidymodels, I was no longer able to run some other codes of mine, which relied only on the tidyverse.
Simple operations like bind_rows went broken. I will open a separate bug, but it seems that the development version of dplyr, which forces me to update also vctrs, has some issues. Please disregard this if you find it not relevant. I am catching straws to debug.

1 Like

I cannot reproduce. See the session info at the end to see if any of your package versions are dissimilar.

library(tidyverse)
library(countrycode)
library(janitor)
#> 
#> Attaching package: 'janitor'
#> The following objects are masked from 'package:stats':
#> 
#>     chisq.test, fisher.test
# library(GGally)
library(tidymodels)
#> ── Attaching packages ──────────────────────────────────────────────────────────────────────────────────── tidymodels 0.1.0 ──
#> ✓ broom     0.5.4      ✓ rsample   0.0.6 
#> ✓ dials     0.0.6      ✓ tune      0.1.0 
#> ✓ infer     0.5.1      ✓ workflows 0.1.0 
#> ✓ parsnip   0.0.5      ✓ yardstick 0.0.5 
#> ✓ recipes   0.1.10
#> ── Conflicts ─────────────────────────────────────────────────────────────────────────────────────── tidymodels_conflicts() ──
#> x scales::discard() masks purrr::discard()
#> x dplyr::filter()   masks stats::filter()
#> x recipes::fixed()  masks stringr::fixed()
#> x dplyr::lag()      masks stats::lag()
#> x dials::margin()   masks ggplot2::margin()
#> x yardstick::spec() masks readr::spec()
#> x recipes::step()   masks stats::step()
library(doParallel)
#> Loading required package: foreach
#> 
#> Attaching package: 'foreach'
#> The following objects are masked from 'package:purrr':
#> 
#>     accumulate, when
#> Loading required package: iterators
#> Loading required package: parallel
library(ranger)

### read the raw data

food_consumption <- readr::read_csv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-02-18/food_consumption.csv")
#> Parsed with column specification:
#> cols(
#>   country = col_character(),
#>   food_category = col_character(),
#>   consumption = col_double(),
#>   co2_emmission = col_double()
#> )

### get the data in shape for mining. "asia" is now the column you want to predict 

food <- food_consumption %>%
  select(-co2_emmission) %>%
  pivot_wider(
    names_from = food_category,
    values_from = consumption
  ) %>%
  clean_names() %>%
  mutate(continent = countrycode(
    country,
    origin = "country.name",
    destination = "continent"
  )) %>%
  mutate(asia = case_when(
    continent == "Asia" ~ "Asia",
    TRUE ~ "Other"
  )) %>%
  select(-country, -continent) %>%
  mutate_if(is.character, factor)

set.seed(1234)
food_boot <- bootstraps(food, times = 30)

rf_spec <- rand_forest(
  mode = "classification",
  mtry = tune(),
  trees = 1000,
  min_n = tune()
) %>%
  set_engine("ranger")

rf_grid <- 
  rf_spec %>% 
  tune_grid(
    asia ~ .,
    resamples = food_boot
  )
#> i Creating pre-processing data to finalize unknown parameter: mtry

Created on 2020-04-03 by the reprex package (v0.3.0)

Session info
devtools::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#>  setting  value                       
#>  version  R version 3.6.1 (2019-07-05)
#>  os       macOS Mojave 10.14.6        
#>  system   x86_64, darwin15.6.0        
#>  ui       X11                         
#>  language (EN)                        
#>  collate  en_US.UTF-8                 
#>  ctype    en_US.UTF-8                 
#>  tz       America/New_York            
#>  date     2020-04-03                  
#> 
#> ─ Packages ───────────────────────────────────────────────────────────────────
#>  package       * version     date       lib
#>  assertthat      0.2.1       2019-03-21 [1]
#>  backports       1.1.5       2019-10-02 [1]
#>  base64enc       0.1-3       2015-07-28 [1]
#>  bayesplot       1.7.0       2019-05-23 [1]
#>  boot            1.3-24      2019-12-20 [1]
#>  broom         * 0.5.4       2020-01-27 [1]
#>  callr           3.4.3       2020-03-28 [1]
#>  cellranger      1.1.0       2016-07-27 [1]
#>  class           7.3-15      2019-01-01 [1]
#>  cli             2.0.2       2020-02-28 [1]
#>  codetools       0.2-16      2018-12-24 [1]
#>  colorspace      1.4-1       2019-03-18 [1]
#>  colourpicker    1.0         2017-09-27 [1]
#>  countrycode   * 1.1.0       2018-10-27 [1]
#>  crayon          1.3.4       2017-09-16 [1]
#>  crosstalk       1.0.0       2016-12-21 [1]
#>  curl            4.3         2019-12-02 [1]
#>  DBI             1.1.0       2019-12-15 [1]
#>  dbplyr          1.4.2       2019-06-17 [1]
#>  desc            1.2.0       2018-05-01 [1]
#>  devtools        2.2.1       2019-09-24 [1]
#>  dials         * 0.0.6       2020-04-02 [1]
#>  DiceDesign      1.8-1       2019-07-31 [1]
#>  digest          0.6.25      2020-02-23 [1]
#>  doParallel    * 1.0.15      2019-08-02 [1]
#>  dplyr         * 0.8.5       2020-03-07 [1]
#>  DT              0.11        2019-12-19 [1]
#>  dygraphs        1.1.1.6     2018-07-11 [1]
#>  ellipsis        0.3.0       2019-09-20 [1]
#>  evaluate        0.14        2019-05-28 [1]
#>  fansi           0.4.1       2020-01-08 [1]
#>  fastmap         1.0.1       2019-10-08 [1]
#>  forcats       * 0.4.0       2019-02-17 [1]
#>  foreach       * 1.5.0       2020-03-30 [1]
#>  fs              1.4.0       2020-03-31 [1]
#>  furrr           0.1.0       2018-05-16 [1]
#>  future          1.16.0      2020-01-16 [1]
#>  generics        0.0.2       2018-11-29 [1]
#>  ggplot2       * 3.3.0       2020-03-05 [1]
#>  ggridges        0.5.1       2018-09-27 [1]
#>  globals         0.12.5      2019-12-07 [1]
#>  glue            1.4.0       2020-04-03 [1]
#>  gower           0.2.1       2019-05-14 [1]
#>  GPfit           1.0-8       2019-02-08 [1]
#>  gridExtra       2.3         2017-09-09 [1]
#>  gtable          0.3.0       2019-03-25 [1]
#>  gtools          3.8.2       2020-03-31 [1]
#>  hardhat         0.1.2       2020-02-28 [1]
#>  haven           2.2.0       2019-11-08 [1]
#>  highr           0.8         2019-03-20 [1]
#>  hms             0.5.3       2020-01-08 [1]
#>  htmltools       0.4.0       2019-10-04 [1]
#>  htmlwidgets     1.5.1       2019-10-08 [1]
#>  httpuv          1.5.2       2019-09-11 [1]
#>  httr            1.4.1       2019-08-05 [1]
#>  igraph          1.2.4.2     2019-11-27 [1]
#>  infer         * 0.5.1       2019-11-19 [1]
#>  inline          0.3.15      2018-05-18 [1]
#>  ipred           0.9-9       2019-04-28 [1]
#>  iterators     * 1.0.12      2019-07-26 [1]
#>  janeaustenr     0.1.5       2017-06-10 [1]
#>  janitor       * 1.2.0       2019-04-21 [1]
#>  jsonlite        1.6.1       2020-02-02 [1]
#>  knitr           1.28        2020-02-06 [1]
#>  later           1.0.0       2019-10-04 [1]
#>  lattice         0.20-38     2018-11-04 [1]
#>  lava            1.6.7       2020-03-05 [1]
#>  lhs             1.0.1       2019-02-03 [1]
#>  lifecycle       0.2.0       2020-03-06 [1]
#>  listenv         0.8.0       2019-12-05 [1]
#>  lme4            1.1-21      2019-03-05 [1]
#>  loo             2.1.0       2019-03-13 [1]
#>  lubridate       1.7.4       2018-04-11 [1]
#>  magrittr        1.5         2014-11-22 [1]
#>  markdown        1.1         2019-08-07 [1]
#>  MASS            7.3-51.5    2019-12-20 [1]
#>  Matrix          1.2-18      2019-11-27 [1]
#>  matrixStats     0.55.0      2019-09-07 [1]
#>  memoise         1.1.0       2017-04-21 [1]
#>  mime            0.9         2020-02-04 [1]
#>  miniUI          0.1.1.1     2018-05-18 [1]
#>  minqa           1.2.4       2014-10-09 [1]
#>  modelr          0.1.5       2019-08-08 [1]
#>  munsell         0.5.0       2018-06-12 [1]
#>  nlme            3.1-140     2019-05-12 [1]
#>  nloptr          1.2.1       2018-10-03 [1]
#>  nnet            7.3-12      2016-02-02 [1]
#>  parsnip       * 0.0.5       2020-01-07 [1]
#>  pillar          1.4.3       2019-12-20 [1]
#>  pkgbuild        1.0.6       2019-10-09 [1]
#>  pkgconfig       2.0.3       2019-09-22 [1]
#>  pkgload         1.0.2       2018-10-29 [1]
#>  plyr            1.8.6       2020-03-03 [1]
#>  prettyunits     1.1.1       2020-01-24 [1]
#>  pROC            1.16.1      2020-01-14 [1]
#>  processx        3.4.2       2020-02-09 [1]
#>  prodlim         2019.11.13  2019-11-17 [1]
#>  promises        1.1.0       2019-10-04 [1]
#>  ps              1.3.2       2020-02-13 [1]
#>  purrr         * 0.3.3       2019-10-18 [1]
#>  R6              2.4.1       2019-11-12 [1]
#>  ranger        * 0.12.1      2020-01-10 [1]
#>  Rcpp            1.0.4       2020-03-17 [1]
#>  readr         * 1.3.1       2018-12-21 [1]
#>  readxl          1.3.1       2019-03-13 [1]
#>  recipes       * 0.1.10      2020-03-18 [1]
#>  remotes         2.1.0       2019-06-24 [1]
#>  reprex          0.3.0       2019-05-16 [1]
#>  reshape2        1.4.3       2017-12-11 [1]
#>  rlang           0.4.5       2020-03-01 [1]
#>  rmarkdown       2.1         2020-01-20 [1]
#>  rpart           4.1-15      2019-04-12 [1]
#>  rprojroot       1.3-2       2018-01-03 [1]
#>  rsample       * 0.0.6       2020-03-31 [1]
#>  rsconnect       0.8.15      2019-07-22 [1]
#>  rstan           2.19.2      2019-07-09 [1]
#>  rstanarm        2.19.2      2019-10-03 [1]
#>  rstantools      2.0.0       2019-09-15 [1]
#>  rstudioapi      0.11        2020-02-07 [1]
#>  rvest           0.3.5       2019-11-08 [1]
#>  scales        * 1.1.0       2019-11-18 [1]
#>  sessioninfo     1.1.1       2018-11-05 [1]
#>  shiny           1.4.0       2019-10-10 [1]
#>  shinyjs         1.0         2018-01-08 [1]
#>  shinystan       2.5.0       2018-05-01 [1]
#>  shinythemes     1.1.2       2018-11-06 [1]
#>  snakecase       0.11.0.9000 2019-11-25 [1]
#>  SnowballC       0.6.0       2019-01-15 [1]
#>  StanHeaders     2.19.0      2019-09-07 [1]
#>  stringi         1.4.6       2020-02-17 [1]
#>  stringr       * 1.4.0       2019-02-10 [1]
#>  survival        3.1-10      2020-02-04 [1]
#>  testthat        2.3.2       2020-03-02 [1]
#>  threejs         0.3.1       2017-08-13 [1]
#>  tibble        * 3.0.0       2020-03-30 [1]
#>  tidymodels    * 0.1.0       2020-02-16 [1]
#>  tidyposterior   0.0.2       2018-11-15 [1]
#>  tidypredict     0.4.3       2020-01-07 [1]
#>  tidyr         * 1.0.2       2020-01-24 [1]
#>  tidyselect      1.0.0       2020-01-27 [1]
#>  tidytext        0.2.2       2019-07-29 [1]
#>  tidyverse     * 1.3.0       2019-11-21 [1]
#>  timeDate        3043.102    2018-02-21 [1]
#>  tokenizers      0.2.1       2018-03-29 [1]
#>  tune          * 0.1.0       2020-04-02 [1]
#>  usethis         1.5.1.9000  2020-04-03 [1]
#>  vctrs           0.2.4       2020-03-10 [1]
#>  withr           2.1.2       2018-03-15 [1]
#>  workflows     * 0.1.0       2019-12-30 [1]
#>  xfun            0.12        2020-01-13 [1]
#>  xml2            1.2.5       2020-03-11 [1]
#>  xtable          1.8-4       2019-04-21 [1]
#>  xts             0.12-0      2020-01-19 [1]
#>  yaml            2.2.1       2020-02-01 [1]
#>  yardstick     * 0.0.5       2020-01-23 [1]
#>  zoo             1.8-7       2020-01-10 [1]
#>  source                                 
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.2)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.1)                         
#>  CRAN (R 3.6.1)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  local                                  
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.1)                         
#>  CRAN (R 3.6.2)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.1)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.2)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.1)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.1)                         
#>  CRAN (R 3.6.1)                         
#>  CRAN (R 3.6.1)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.1)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.1)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  local                                  
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.1)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  Github (Tazinho/snakecase@64e1726)     
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  Github (therneau/survival@a99481d)     
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.1)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  Github (tidymodels/tidypredict@75a9639)
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.1)                         
#>  Github (r-lib/usethis@7f01cf9)         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.1)                         
#>  CRAN (R 3.6.1)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#>  CRAN (R 3.6.0)                         
#> 
#> [1] /Library/Frameworks/R.framework/Versions/3.6/Resources/library
1 Like

Hi Max,
Well, after reinstalling the cran version of tidymodels and replacing the dev version of dplyr with the one on cran, I can run the script on my machine.
I believe that this was all due to the dplyr package, but it would be interesting to see if you (or anyone else) can reproduce my bug after installing the develpment version of dplyr.
For the moment, case closed.

1 Like

Great. Please mark this as the solution for the benefit of those to follow. (No false modesty allowed.)

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.