0

I have a functioning R_Markdown file that I am currently trying to knit into a word document, but each time I do, I get this error message:

Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : 
  namespace 'glue' 1.4.2 is being loaded, but >= 1.6.1 is required
Calls: <Anonymous> ... namespaceImportFrom -> asNamespace -> loadNamespace
Execution halted

I have all of these packages brought up in library:

library(scales)
library(rlang)
library(dplyr)
library(readxl)
library(ggplot2)
library(plyr)
library(rmarkdown)

I am at a loss for what to do.

I looked up other similar errors and there was a lot of suggestions having to do with packages and installations and reinstallations, but I'm very confused because I haven't found the "namespace 'glue' " detail anywhere, so I'm wondering if this is something other than a package. I just need the word document for the R_markdown to share my code with some colleagues. Thank you for your help!

  • 2
    [`glue`](https://cran.r-project.org/web/packages/glue/index.html) is a package used by several packages you are attaching here (`ggplot2`, `rlang`, etc). Have you tried [updating](https://stackoverflow.com/questions/21461649/how-to-update-a-package-in-r) your version of `glue`? – LMc Jul 26 '23 at 19:08
  • 2
    A common problem where that error pops up is that `install.packages` is called, and a dependency needs to be upgraded but cannot because it is already loaded. The fix: restart R (***fresh***, no packages loaded), then update `glue` itself, then try your other steps again (loading other packages as needed). FWIW, I haven't seen many projects recently that truly require `plyr`, the exceptions being tutorials or lesson plans that haven't been updated in years. Just my 2 cents, granted, but much of its functionality has been very-much-improved in newer packages. – r2evans Jul 26 '23 at 19:12
  • 1
    Thank you! I uninstalled and reinstalled glue and it knit just fine! I also appreciate the advice on the plyr package since I haven't used R in a while. Hope you have a great day! @r2evans – Miguel Von Fedak Jul 27 '23 at 13:27

0 Answers0