ropensci / dynamite

Bayesian Inference of Complex Panel Data
https://docs.ropensci.org/dynamite/
GNU General Public License v3.0
27 stars 1 forks source link

tidyverse Package Conflicts #80

Closed emstruong closed 7 months ago

emstruong commented 7 months ago

Hello,

There appears to be internal package conflicts between dynamite and tidyverse ?

library(conflicted)
library(data.table)
library(tidyverse)
library(dynamite)
fit <- dynamite(
  dformula = obs(y ~ -1 + varying(~x), family = "gaussian") +
    lags(type = "varying") +
    splines(df = 20),
  gaussian_example,
  "time",
  "id",
  chains = 1,
  refresh = 0
)
#> Error:
#> ! [conflicted] between found in 2 packages.
#> Either pick the one you want with `::`:
#> • dplyr::between
#> • data.table::between
#> Or declare a preference with `conflicts_prefer()`:
#> • `conflicts_prefer(dplyr::between)`
#> • `conflicts_prefer(data.table::between)`

Created on 2024-04-14 with reprex v2.1.0

helske commented 7 months ago

Hi, This is strange because as far as I know, dynamite does not use any between function.

helske commented 7 months ago

The conflict is actually from rstan:

> code <- get_code(gaussian_example_fit)
> rstan::stan_model(model_code = code)
Error:
! [conflicted] between found in 2 packages.
Either pick the one you want with `::`:
• data.table::between
• dplyr::between
Or declare a preference with `conflicts_prefer()`:
• conflicts_prefer(data.table::between)
• conflicts_prefer(dplyr::between)
Run `rlang::last_trace()` to see where the error occurred.
santikka commented 7 months ago

This conflicted package seems strange, you can get conflicts from base packages that do not even call the function in question:

> library("conflicted")
> library("dplyr")
> apropos("f", mode = "S4")
Error:
! [conflicted] filter found in 2 packages.
Either pick the one you want with `::`:
• dplyr::filter
• stats::filter
Or declare a preference with `conflicts_prefer()`:
• `conflicts_prefer(dplyr::filter)`
• `conflicts_prefer(stats::filter)`
Run `rlang::last_trace()` to see where the error occurred.

I'm closing this issue, as it does not seem relevant to dynamite.