I had some functions in a package that stopped working the other day; and have now found that the problems appear to be with hardhat versions. My package does not have hardhat as an explicit dependency (i.e., hardhat is a dependency of one of my package's dependency)
The exmple code below works fine when using hardhat_0.1.4.tar.gz but with the new version of hardhat on CRAN it gives this error:
Error: 'arg_match0' is not an exported object from 'namespace:rlang'
library(tidymodels)
library(tidyverse)
x1 <- runif(40)
x2 <- runif(40)
x3 <- runif(40)
y <- runif(40)
data_train1 <- tibble(x1, x2, x3, y)
xy_recipe <- data_train1 %>%
recipes::recipe(y ~ .)
# Create and fit model
mod_spec <- parsnip::linear_reg(penalty = 1, mixture = 1) %>%
parsnip::set_engine("glmnet")
# Create Workflow (to know variable roles from recipes) help(workflow)
wf <- workflows::workflow() %>%
workflows::add_model(mod_spec) %>%
workflows::add_recipe(xy_recipe)
# Fit model
mod <- parsnip::fit(wf, data = data_train1)
mod
# To install hardhat_0.1.4.tar.gz
PackageUrl <- "http://cran.r-project.org/src/contrib/Archive/hardhat/hardhat_0.1.4.tar.gz"
install.packages(PackageUrl, repos=NULL, type="source")