0

I'm trying to run a complex (and confidential) package that I use for work. I've run the package many times in the past, but am not able to run it now (in the interim, I likely updated R Studio and/or my installed packages). My coworkers are able run the package on their machines while using previous versions of the packages.

Tidyverse is a required package for the package that I am trying to use and is attached when I run the custom package (that was developed by a contractor for my company long before I joined who has since left). I'm able to match/load previous versions of the all tidyverse packages except for dplyr. I'm using 1.0.10 and my coworkers are using 1.0.8, but I get a tidyverse error message that it is no longer supporting versions of dplyr before 1.0.10.

Any thoughts on how I might go about debugging? I know that it's difficult without example code, but unfortunately I am not able to create a synthetic version and share.

I've tried debugging if it's a masking issue by using the conflicted package (i.e. conflict_prefer("mutate", "dplyr") and incorporating syntax (i.e. dplyr::mutate) throughout the function/script that is getting the error.

The error that I'm getting is:

Error in mutate():
! Problem while computing *calculatedfield*= pmap(...). Caused by error in gather(): ! Can't subset columns that don't exist. x Columns 2020, 2021, 2022, 2023, 2024, etc. don't exist. (These columns are present when running the script line by line and unnesting the tibble)

user438383
  • 5,716
  • 8
  • 28
  • 43
  • If it works on your coworkers machine, then try to install the older versions of packages: https://stackoverflow.com/questions/17082341/installing-older-version-of-r-package. The `tidyverse` package itself should have an older version as well. Since the `tidyverse` package it really just a collection of other packages, it shouldn't be a requirement to load it before loading a different package. The specific error could be caused by updates to functions. It looks like it's trying to use invalid/non-standard column names. Without knowing what the code is doing it's nearly impossible to help. – MrFlick Jan 03 '23 at 20:42
  • 2
    You can use the *archive* link on CRAN to access [an old version of `dplyr`](https://cran.r-project.org/src/contrib/Archive/dplyr/) and install it. You can also use the [checkpoint package](https://cran.r-project.org/web/packages/checkpoint/index.html) for this. For future-proofing, you may want to look at solutions like [renv](https://rstudio.github.io/renv/articles/renv.html). – Gregor Thomas Jan 03 '23 at 20:43
  • @GregorThomas This is the message I get when trying to load the older dplyr version/package:Loading required package: tidyverse Error: package or namespace load failed for ‘tidyverse’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]): namespace ‘dplyr’ 1.0.8 is already loaded, but >= 1.0.9 is required Error: package ‘tidyverse’ could not be loaded – Lauren Snyder Jan 03 '23 at 21:26
  • @MrFlick please see error message above – Lauren Snyder Jan 03 '23 at 21:28
  • What version of `tidyverse` is installed on your coworkers computer? Are you sure it is the same as what you are using? – MrFlick Jan 03 '23 at 21:32
  • As Mr Flick said, sounds like you need to install an older version of `tidyverse` too. You can [go to the CRAN page for `tidyverse`](https://CRAN.R-project.org/package=tidyverse), click the link where it say "old sources: tidyverse archive", and download and install an older version of `tidyverse`, perhaps one with a release date just a little bit after the `dplyr 1.0.9` release. Or ask your coworkers what `tidyverse` version they are using. – Gregor Thomas Jan 03 '23 at 21:33
  • Thanks @MrFlick Unfortunately, I've tried with previous Tidyverse packages. My coworkers are using tidyverse 1.3.0, and also dplyr 1.0.8, but I get the above message when I try to install tidyverse 1.3.0 and the install fails. The package/model that I am trying to run requires >=1.3.0 tidyverse. Any ideas why my coworkers are able to use this combo of tidyverse and dplyr versions but I am not able to load them? – Lauren Snyder Jan 04 '23 at 20:04
  • also question for you @GregorThomas - thank you both for help trouble shooting! – Lauren Snyder Jan 04 '23 at 20:05
  • 1
    It's not clear to me which error message you are getting when installing tidyverse. The messages you've shown seem specific to loading, not installing the package. Are you using the same R version? If you have the same R version you should be able to install the exact same versions of all the packages on your co-workers machine and get the same result. Perhaps you have a different version for a dependency or something. Look at `installed.packages()` on a working machine and install exactly those same package versions. – MrFlick Jan 04 '23 at 21:05

0 Answers0