Giter Site home page Giter Site logo

multilevelmod's People

Contributors

a-difabio avatar emilhvitfeldt avatar hfrick avatar juliasilge avatar shah-in-boots avatar topepo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

multilevelmod's Issues

Error when using the model with fit_resamples()

Hello,
I am trying to perform k-fold cross validation on an lmer (linear mixed effects) model using this package and tidymodels method. But, i keep getting the following error with the fit_resamples() function.

"Error: The first argument to [fit_resamples()] should be either a model or workflow."

Following is a reprex

library(multilevelmod)
data(sleepstudy, package = "lme4")

mixed_model_spec <- linear_reg() %>% set_engine("lmer")

mixed_model_fit <- 
  mixed_model_spec %>% 
  fit(Reaction ~ Days + (Days | Subject), data = sleepstudy)

set.seed(345)
folds <- vfold_cv(sleepstudy, v = 5)
folds 

library(tune)
set.seed(456)
fit_rs<-fit_resamples(mixed_model_fit, folds)

Default prediction mode for lmer - re.form = NA

When using the lmer engine, would it make more sense for the default predictions to be the same as the lmer default (re.form = NULL)? Currently the default uses re.form = NA

Perhaps there's a good reason I'm not aware of, but when adapting a lmer model into the tidymodels framework, I'd imagine most people would expect the predictions to default to the same as lmer.

Thanks

Combining Feature selection and mixed effects models: Error in eval(predvars, data, env): object ' ' not found

Hi developers,

I would like to know how to update the formula used in a workflow object during the fitting step, after a feature selection (FS) pre-processing step was performed.
The current issues is that when running the fit function I get "Error in eval(predvars, data, env) : object 'Var1' not found". It happens since the FS extracted that predictor, but the formula still considered it.
I had to add the formula using add_model, since I am working with a linear mixed effect for classification, and so far I could not find a way to set the random effects ("ID") in a recipe object.

Case example:

predictors_list <- c("Var1", "Var2")
recipe <- recipe(dataset)%>% ... %>% step_select_boruta(all_predictors(), outcome = "Disease")

 recipe <-
    recipe %>% add_role("ID", new_role = "predictor")
    mixed_effects_formula <- as.formula(
      paste(
        "Disease ~ ",
        paste(c(predictors_list, "(1|ID)"), collapse = " + ")
      )
    )
    wflow <- workflow() %>%
      add_recipe(recipe) %>%
      add_model(model, formula = mixed_effects_formula)

  fitted_model <-
    fit(
      wflow,
      data = data_train
    )
"Error in eval(predvars, data, env) : object 'Var1' not found"

Thanks in advance
Any help it is really appreciated
Best
Alberto

Including random effects in a recipe and fit resamples?

Hi,

I apologize if this functionality is in-place somewhere already, but can you include the ability to use recipes with a mixed effect model?

I have found a way to do that, but it looks like it cannot be fit using fit_resamples.

For example.

library(multilevelmod)
library(tidymodels)
library(tidyverse)
library(lme4)


testdf <- structure(list(RER = c(0.949, 0.929, 0.935, 0.89, 0.911, 0.85, 
                                 0.868, 0.85, 0.913, 0.969), Time = c(30, 60, 120, 60, 70, 15, 
                                                                      74.711, 50, 140, 40), Intensity = c(58, 72.6, 70, 68, 68.527, 
                                                                                                          60, 70, 45, 70, 70), Study = c("Duhamel 2006", "Helge 1998", 
                                                                                                                                         "Van Zant 1997", "Parcell 1999", "Palmer 1999", "Lane 2015", 
                                                                                                                                         "Helge 1996", "Arkinstall 2004b", "Van Zant 1997", "Tarnopolsky 1995"
                                                                                                          )), row.names = c(NA, -10L), class = c("tbl_df", "tbl", "data.frame"
                                                                                                          )) %>% as.data.frame()

mixed_model_spec <- linear_reg() %>% set_engine("lmer")

mixed_model_fit <- 
  mixed_model_spec %>% 
  fit(RER ~ Time + Intensity  +(1 | Study), data = testdf)

mixed_model_fit 


# That worked well, but creating this as a recipe with a random effect causes an error

basic_recipe <- recipe(RER ~ Time + Intensity + (1 | Study), data = testdf) %>% 
  step_bs(Intensity )


# Alternatively, I can prep/juice the recipe without the random effect:

juiced_recipe <- recipe(RER ~ ., data = testdf) %>% 
  step_bs(Intensity) %>% prep() %>% juice()

#and then run a model like this to take advantage of any recipe steps I might want to add:

test_model <- mixed_model_spec %>% 
  fit(RER ~ . -Study  + (1 | Study), data = juiced_recipe)

test_model 

# But it doesn't seem like there is a way to use fit_resamples on the mixed model spec? I would imagine something like this, which doesn't work because the 'basic_recipe' doesn't run

testfolds <- vfold_cv(testdf, v = 5)
control <- control_resamples(save_pred = TRUE)

model_res <- fit_resamples(mixed_model_spec, basic_recipe, testfolds, control = control)

Thank you

Can I use lme()?

I am super happy to see this package coming to life! Is there a way to interface with lme() or is it in the pipeline somewhere? I think I need it to accommodate heterogeneous error variance (which I think lmer() cannot do).

Release multilevelmod 0.1.0

First release:

Prepare for release:

  • git pull
  • devtools::build_readme()
  • urlchecker::url_check()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • Review pkgdown reference index for, e.g., missing topics
  • git push
  • Draft blog post

Submit to CRAN:

  • usethis::use_version('minor')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • git push
  • usethis::use_github_release()
  • usethis::use_dev_version()
  • usethis::use_news_md()
  • git push
  • Finish blog post
  • Tweet
  • Add link to blog post in pkgdown news menu

Require glmmLasso model

Hi, Tidymodels team,
Thanks for this great supplementary package! I am working on fitting a logistic mixed model. As I known, the glmer function is used in this package to fit this model. However, I also want to use regularization algorithms like LASSO to select variables. Is it possible to realize by multilevelmod ? Or, is it possible to add models like glmmLasso into this package?

Incorrect predictions from fit_resamples() when applied to lmer model

I am having trouble using the tune::fit_resamples() function on a lmer model (from the multilevelmod package).
In particular, it looks like that when the predictions for the assessment set are calculated, the model doesn't properly account for all the possible combinations of grouping levels.

I have included a reprex in which I show that the results of a predict() call on a lmer object are different than the predictions obtained from a fit_resamples() call (using collect_predictions()).

library(tidyverse)
library(tidymodels)
library(multilevelmod)

data(mpg, package = "ggplot2")

set.seed(123)

lmer_model = linear_reg() %>% 
  set_engine("lmer")

lmer_workflow = workflow() %>% 
  add_variables(outcomes = cty,
                predictors = c(year, manufacturer, model)) %>% 
  add_model(lmer_model, formula = cty ~ year + (1|manufacturer/model))

mpg_split = mpg %>% validation_split(prop = 3/4)

analysis = mpg_split$splits[[1]] %>% analysis()
assessment = mpg_split$splits[[1]] %>% assessment()

# using predict() on the assessment dataset works as expected
predicted_via_workflow = lmer_workflow %>%
  fit(analysis) %>%
  extract_fit_engine() %>%
  predict(assessment) %>%
  plot()

# the predictions from the fit_resamples() function do not vary per group
predicted_via_tune = lmer_workflow %>% 
  fit_resamples(mpg_split, control = control_resamples(allow_par = FALSE,
                                                       save_pred = TRUE)) %>% 
  collect_predictions() %>%
  pluck(".pred") %>%
  plot()

Created on 2022-06-20 by the reprex package (v2.0.1)

New model request: glmmLasso

Thanks for creating a tidymodels interface for multilevel models. It would be great to also add regularized multilevel regressions, such as glmmLasso.

Adding GEE models?

Hi. I've started working on making GEE model specifications using the gee package to be compatible with parsnip. I'm wondering if its better than, instead of keeping them just in my own loading functions, to integrate it with pre-existing packages, but not sure if:

  1. GEEs have already been added
  2. If this is the right repository/package for that topic.

GLMs and GEE are similar to me, but have different interpretations. I would like to be able to add population-based interpretations (instead of cluster-specific subject interpretations).

Using multilevelmod to enable butcher to understand lme4

I am trying to use the butcher package to cut down on the size of fitted objects, in my case fits using lme4::lmer. That led me to parsnip, then here!

I would have thought this would work, but it doesn't.

library(multilevelmod)
#> Loading required package: parsnip
data(sleepstudy, package = "lme4")

mixed_model_spec <- linear_reg() %>% set_engine("lmer")

mixed_model_fit <- 
  mixed_model_spec %>% 
  fit(Reaction ~ Days + (Days | Subject), data = sleepstudy)

mixed_model_fit

Checking the size of the fits:

> object.size(mixed_model_fit)
67120 bytes
> object.size(butcher(mixed_model_fit))
67120 bytes

What am I missing?

Add examples for using recipes and model formulas

Thanks a lot for this package, it's a great addition to tidymodels! I've been following the conversation on multilevel models and tidymodels somewhere else I can't remember and I think it would be very useful to provide some documentation (vignette, README) on how to combine recipes and model formulas.

This can become a bit complex if your recipe is very long and then having to define the model formula separately.

Just leaving it here in case it's useful.

Logistic_reg() not working with stan-glmer

Thanks for the great package!

When trying to use logistic regression as suggested, it returns an error “Error: engine ‘stan-glmer’ is not available.

library(multilevelmod)
hier_model_spec <- logistic_reg() %>% set_engine("stan-glmer")

Upkeep for multilevelmod 2023

Pre-history

  • usethis::use_readme_rmd()
  • usethis::use_roxygen_md()
  • usethis::use_github_links()
  • usethis::use_pkgdown_github_pages()
  • usethis::use_tidy_github_labels()
  • usethis::use_tidy_style()
  • usethis::use_tidy_description()
  • urlchecker::url_check()

2020

  • usethis::use_package_doc()
    Consider letting usethis manage your @importFrom directives here.
    usethis::use_import_from() is handy for this.
  • usethis::use_testthat(3) and upgrade to 3e, testthat 3e vignette
  • Align the names of R/ files and test/ files for workflow happiness.
    The docs for usethis::use_r() include a helpful script.
    usethis::rename_files() may be be useful.

2021

  • usethis::use_tidy_dependencies()
  • usethis::use_tidy_github_actions() and update artisanal actions to use setup-r-dependencies
  • Remove check environments section from cran-comments.md
  • Bump required R version in DESCRIPTION to 3.5
  • Use lifecycle instead of artisanal deprecation messages, as described in Communicate lifecycle changes in your functions
  • Make sure RStudio appears in Authors@R of DESCRIPTION like so, if appropriate:
    person("RStudio", role = c("cph", "fnd"))

2022

2023

Necessary:

  • Update copyright holder in DESCRIPTION: person(given = "Posit Software, PBC", role = c("cph", "fnd"))
  • Double check license file uses '[package] authors' as copyright holder. Run use_mit_license()
  • Update email addresses *@rstudio.com -> *@posit.co
  • Update logo (https://github.com/rstudio/hex-stickers); run use_tidy_logo()
  • usethis::use_tidy_coc()
  • usethis::use_tidy_github_actions()

Optional:

  • Review 2022 checklist to see if you completed the pkgdown updates
  • Prefer pak::pak("org/pkg") over devtools::install_github("org/pkg") in README
  • Consider running use_tidy_dependencies() and/or replace compat files with use_standalone()
  • use_standalone("r-lib/rlang", "types-check") instead of home grown argument checkers
  • Add alt-text to pictures, plots, etc; see https://posit.co/blog/knitr-fig-alt/ for examples

bug in when using there is mismatch between number of labels in training and testing data set.

I found this problem in https://stackoverflow.com/questions/72349462/r-using-a-lmer-model-in-fit-resamples-fails-with-error-assigned-data-facto and condensed it further down, to this:

@hfrick:

that seems weird. multilevelmod::reformat_lme_pred_data() breaks because there are no factor levels. I quickly checked if it makes a difference if you turn manufacturer and model into factors before you do anything else but that’s not it.

library(tidyverse)
library(tidymodels)
library(multilevelmod)

data(mpg, package = "ggplot2")

lmm_model = linear_reg() %>% 
  set_engine("lmer")

lmm_workflow = workflow() %>% 
  add_variables(outcomes = cty,
                predictors = c(year, manufacturer, model)) %>% 
  add_model(lmm_model, formula = cty ~ year + (1|manufacturer/model))

# A simple fit works
lmm_fit <- fit(lmm_workflow, mpg)

predict(lmm_fit, new_data = mpg)
#> Error:
#> ! Assigned data `factor(lvl[1], levels = lvl)` must be compatible with existing data.
#> ✖ Existing data has 234 rows.
#> ✖ Assigned data has 0 rows.
#> ℹ Only vectors of size 1 are recycled.

extracting parameter sets of MCMC iterations from `model_fit` object

This is a really fantastic package! When building bayesian multilevel models I often want to generate posterior predictive distributions that you can only create when you have access to all of the parameter sets from the MCMC iterations. I may just not be able to find how to do this, but if it isn't currently possible, it would be hugely helpful to be able to extract these when using this package to build the models.

Since the multilevelmod uses the engine stan_glm I'll show how you can get these parameter sets when building these models strictly with rstanarm::stan_glmer().

These data and code come from Chapter 17 of the BayesRules! book.

library(tidymodels)
library(tidyverse)
library(multilevelmod)
library(bayesrules)
library(rstanarm)

data(cherry_blossom_sample)
running <- cherry_blossom_sample

running_model_1 <- stan_glmer(
  net ~ age + (1 | runner), 
  data = running, family = gaussian,
  prior_intercept = normal(100, 10),
  prior = normal(2.5, 1), 
  prior_aux = exponential(1, autoscale = TRUE),
  prior_covariance = decov(reg = 1, conc = 1, shape = 1, scale = 1),
  chains = 4, iter = 5000*2, seed = 84735)

simply running

as.data.frame(running_model_1)

gives us the parameter sets for each final MCMC iteration.

So sorry if there is already a function that does this and I just couldn't find it!

New Model Request: a spatial multilevel model

I am interested in fitting a spatial multilevel model using the tidymodels framework. In the Spatial Regression chapter of Spatial Data Science by Edzer Pebesma and Roger Bivand, the authors demonstrate how this can be done using a dataset of census tracts and air pollution model output zones in Boston. They then demonstrate how to fit a spatial mixed model using the following packages: hglm, HSAR, INLA, R2BayesX and mgcv.

Please consider adding support for one of the above models.

Install multilevelmod

Hi,

I'm trying to install the GitHub version of multilevelmod using devtools::install_github():

devtools::install_github("tidymodels/multilevelmod")

Instead, I'm getting Error: Failed to install 'multilevelmod' from GitHub. I have the most recent version of tidymodels alreayd installed. The complete output I'm seeing is:

Downloading GitHub repo tidymodels/multilevelmod@master
√  checking for file 'C:\Users\user\AppData\Local\Temp\Rtmpwx3kfi\remotes4c846045653\tidymodels-multilevelmod-487354b/DESCRIPTION' (374ms)
-  preparing 'multilevelmod':
√  checking DESCRIPTION meta-information ... 
-  checking for LF line-endings in source and make files and shell scripts
-  checking for empty or unneeded directories
-  building 'multilevelmod_0.0.0.9000.tar.gz'
   
Installing package into ‘C:/Users/user/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
* installing *source* package 'multilevelmod' ...
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
Error: (converted from warning) package 'parsnip' was built under R version 4.0.2
Execution halted
ERROR: lazy loading failed for package 'multilevelmod'
* removing 'C:/Users/user/Documents/R/win-library/4.0/multilevelmod'
Error: Failed to install 'multilevelmod' from GitHub:
  (converted from warning) installation of package ‘C:/Users/user/AppData/Local/Temp/Rtmpwx3kfi/file4c8467a32ad5/multilevelmod_0.0.0.9000.tar.gz’ had non-zero exit status

Running sessionInfo() gets me:

R version 4.0.0 (2020-04-24)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18362)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252 
[2] LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

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

loaded via a namespace (and not attached):
 [1] rstudioapi_0.11   magrittr_1.5      usethis_1.6.1     devtools_2.3.0   
 [5] pkgload_1.0.2     R6_2.4.1          rlang_0.4.7       fansi_0.4.1      
 [9] tools_4.0.0       pkgbuild_1.0.8    xfun_0.14         sessioninfo_1.1.1
[13] tinytex_0.23      cli_2.0.2         withr_2.2.0       ellipsis_0.3.1   
[17] remotes_2.1.1     assertthat_0.2.1  digest_0.6.25     rprojroot_1.3-2  
[21] crayon_1.3.4      processx_3.4.2    callr_3.4.3       fs_1.4.1         
[25] ps_1.3.3          curl_4.3          testthat_2.3.2    memoise_1.1.0    
[29] glue_1.4.1        compiler_4.0.0    desc_1.2.0        backports_1.1.7  
[33] prettyunits_1.1.1

I can see that the CRAN version isn't quite ready for installing. Is there something I'm missing? Thanks!

Are multinom_reg() models supported?

Hi,

The "Get Started" vignette says: "For brevity, we only discuss linear models but the syntax also works for binomial, multinomial, and Poisson outcomes." but I am not sure if it is actually supported. After installing multilevelmod and the dependencies for the supported engines, the only engines available are:

library(multilevelmod)
#> Loading required package: parsnip
show_engines('multinom_reg')
#> # A tibble: 5 × 2
#>   engine mode          
#>   <chr>  <chr>         
#> 1 glmnet classification
#> 2 spark  classification
#> 3 keras  classification
#> 4 nnet   classification
#> 5 brulee classification

Also, multinom_reg() isn't listed as a supported engine in the README. Just wanted to make sure I wasn't missing something.

New model request: gpboost Tree-Boosting with Gaussian Process and Mixed Effects Models

The gpboost package on CRAN by @fabsig explains itself as such:

Combining Tree-Boosting with Gaussian Process and Mixed Effects Models
An R package that allows for combining tree-boosting with Gaussian process and mixed effects models. It also allows for independently doing tree-boosting as well as inference and prediction for Gaussian process and mixed effects models. See https://github.com/fabsig/GPBoost for more information on the software and Sigrist (2020) <arXiv:2004.02653> and Sigrist (2021) <arXiv:2105.08966> for more information on the methodology.

I would suggest that it would make a nice extension to {multilevelmod} due to its ability to model non-linear relationships and work well with high-cardinality categorical data.

From the paper abstract of the approach:

We introduce a novel way to combine boosting with Gaussian process and mixed effects models. This allows for relaxing, first, the zero or linearity assumption for the prior mean function in Gaussian process and grouped random effects models in a flexible non-parametric way and, second, the independence assumption made in most boosting algorithms. The former is advantageous for prediction accuracy and for avoiding model misspecifications. The latter is important for efficient learning of the fixed effects predictor function and for obtaining probabilistic predictions. Our proposed algorithm is also a novel solution for handling high-cardinality categorical variables in tree-boosting. In addition, we present an extension that scales to large data using a Vecchia approximation for the Gaussian process model relying on novel results for covariance parameter inference. We obtain increased prediction accuracy compared to existing approaches on multiple simulated and real-world data sets.

And the main text of the paper:

In summary, both the linearity assumption in Gaussian process models and the independence assumption in boosting are often questionable. The goal of this article is to relax these restrictive assumptions by combining boosting with Gaussian process and mixed effects models. Specifically, we propose to model the mean function using an ensemble of base learners, such as regression trees (Breiman et al., 1984), learned in a stage-wise manner using boosting, and the second-order structure is modeled using a Gaussian process or mixed effects model. In doing so, the parameters of the covariance function are estimated jointly with the mean function; see Section 2 for more details.

The paper is very well written and the package is actively developed on Github, with the last commit from two months ago. Multiple usage examples are linked here, the most comprehensive being this one. Model hyperparameters are explained here.

From the documention, I believe it can work with the following responses:
regression, regression_l1, huber, binary, lambdarank, multiclass

Release multilevelmod 1.0.0

Prepare for release:

  • git pull
  • Check current CRAN check results
  • Check if any deprecation processes should be advanced, as described in Gradual deprecation
  • Polish NEWS
  • devtools::build_readme()
  • urlchecker::url_check()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • revdepcheck::cloud_check()
  • Update cran-comments.md
  • git push
  • Draft blog post
  • Slack link to draft blog in #open-source-comms

Submit to CRAN:

  • usethis::use_version('major')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • git push
  • usethis::use_github_release()
  • usethis::use_dev_version()
  • git push
  • Finish blog post
  • Tweet
  • Add link to blog post in pkgdown news menu

Release multilevelmod 0.2.0

Prepare for release:

  • Check current CRAN check results
  • Polish NEWS
  • devtools::build_readme()
  • urlchecker::url_check()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • revdepcheck::cloud_check()
  • Update cran-comments.md
  • Review pkgdown reference index for, e.g., missing topics

Submit to CRAN:

  • usethis::use_version('minor')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • usethis::use_github_release()
  • usethis::use_dev_version()

Installation of multilevelmod fails

Installing package into ‘/home/sitendu/R/x86_64-pc-linux-gnu-library/4.1’
(as ‘lib’ is unspecified)

  • installing source package ‘multilevelmod’ ...
    ** using staged installation
    ** R
    ** data
    *** moving datasets to lazyload DB
    ** inst
    ** byte-compile and prepare package for lazy loading
    ** help
    *** installing help indices
    *** copying figures
    ** building package indices
    ** installing vignettes
    ** testing if installed package can be loaded from temporary location
    Error: package or namespace load failed for ‘multilevelmod’:
    .onLoad failed in loadNamespace() for 'multilevelmod', details:
    call: parsnip::set_dependency("linear_reg", eng = "stan_glmer", pkg = "rstanarm",
    error: unused argument ("linear_reg")
    Error: loading failed
    Execution halted
    ERROR: loading failed
  • removing ‘/home/sitendu/R/x86_64-pc-linux-gnu-library/4.1/multilevelmod’
    Warning message:
    In i.p(...) :
    installation of package ‘/tmp/RtmpBw23P0/file1b0224081035/multilevelmod_0.0.0.9000.tar.gz’ had non-zero exit status

Move `master` branch to `main`

The master branch of this repository will soon be renamed to main, as part of a coordinated change across several GitHub organizations (including, but not limited to: tidyverse, r-lib, tidymodels, and sol-eng). We anticipate this will happen by the end of September 2021.

That will be preceded by a release of the usethis package, which will gain some functionality around detecting and adapting to a renamed default branch. There will also be a blog post at the time of this master --> main change.

The purpose of this issue is to:

  • Help us firm up the list of targetted repositories
  • Make sure all maintainers are aware of what's coming
  • Give us an issue to close when the job is done
  • Give us a place to put advice for collaborators re: how to adapt

message id: euphoric_snowdog

Installation error from devtools::install_github()

Hi,

thanks for all your great work on tidymodels. I came across this experimental package as I was looking for implementations for parsnip for mixed-effect models as a drop in replacement for brms.

I'm trying to install the package in a docker image which can be launched as follows:

docker run -it miepstei/tidymodels:0.1.1 R

I then tried to install the package as suggested in the README.md but encountered an error.

The reprex is below but the actual error is not reported in the reprex output, but reported when I run the install outside of the reprex command and I included this after.

reprex

devtools::install_github("tidymodels/multilevelmod",upgrade = FALSE)
#> Downloading GitHub repo tidymodels/multilevelmod@HEAD
#>      checking for file ‘/tmp/RtmpeUrGRv/remotes51455dddd75/tidymodels-multilevelmod-8d57d77/DESCRIPTION’ ...  ✓  checking for file ‘/tmp/RtmpeUrGRv/remotes51455dddd75/tidymodels-multilevelmod-8d57d77/DESCRIPTION’
#>   ─  preparing ‘multilevelmod’:
#>      checking DESCRIPTION meta-information ...  ✓  checking DESCRIPTION meta-information
#>   ─  checking for LF line-endings in source and make files and shell scripts
#>   ─  checking for empty or unneeded directories
#>   ─  building ‘multilevelmod_0.0.0.9000.tar.gz’
#>      
#> 
#> Installing package into '/usr/local/lib/R/site-library'
#> (as 'lib' is unspecified)
#> Warning in i.p(...): installation of package '/tmp/RtmpeUrGRv/file5142c062b9a/
#> multilevelmod_0.0.0.9000.tar.gz' had non-zero exit status
sessionInfo()
#> R version 4.1.0 (2021-05-18)
#> Platform: x86_64-pc-linux-gnu (64-bit)
#> Running under: Ubuntu 20.04.3 LTS
#> 
#> Matrix products: default
#> BLAS/LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.8.so
#> 
#> locale:
#>  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
#>  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
#>  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=C             
#>  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
#>  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
#> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> loaded via a namespace (and not attached):
#>  [1] pillar_1.6.4      compiler_4.1.0    highr_0.9         remotes_2.4.1    
#>  [5] prettyunits_1.1.1 tools_4.1.0       testthat_3.1.0    digest_0.6.28    
#>  [9] pkgbuild_1.2.0    pkgload_1.2.3     evaluate_0.14     memoise_2.0.0    
#> [13] lifecycle_1.0.1   tibble_3.1.5      pkgconfig_2.0.3   rlang_0.4.12     
#> [17] reprex_2.0.1      cli_3.0.1         rstudioapi_0.13   curl_4.3.2       
#> [21] yaml_2.2.1        xfun_0.27         fastmap_1.1.0     withr_2.4.2      
#> [25] styler_1.5.1      stringr_1.4.0     knitr_1.36        desc_1.4.0       
#> [29] fs_1.5.0          vctrs_0.3.8       devtools_2.4.2    rprojroot_2.0.2  
#> [33] glue_1.4.2        R6_2.5.1          processx_3.5.2    fansi_0.5.0      
#> [37] rmarkdown_2.11    sessioninfo_1.1.1 purrr_0.3.4       callr_3.7.0      
#> [41] magrittr_2.0.1    usethis_2.1.0     backports_1.2.1   ps_1.6.0         
#> [45] ellipsis_0.3.2    htmltools_0.5.2   utf8_1.2.2        stringi_1.7.5    
#> [49] cachem_1.0.6      crayon_1.4.1

Not included in reprex

Error: package or namespace load failed formultilevelmod:
 .onLoad failed in loadNamespace() for 'multilevelmod', details:
  call: NULL
  error: Model `poisson_reg` has not been registered.
Error: loading failed
Execution halted

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.