tidyverse spontaneously stopped working

I have installed tidy verse. I have used it many times, including yesterday. Suddenly today, I get this error message:

I have tried removing and reinstalling, I get an error message that it cannot find 'system fonts'. I reinstalled these in the terminal, same error message.

I even spent hours updating my Mac to the latest OS, updated R to the latest OS, re ran all these steps and still it tells me it can't find the tidyverse package. Out of ideas... anyone able to help?

I have no idea what is happening but is everything else loading correctly if you delete library(tidyverse)?

It looks like you are it a Quarto or RMarkdown document; will {tidyverse} load in your global environment?

Rather than a screenshot could you supply your code and your YAML as a cut and paste ? Just pas-te everything betwee

```

```
Thanks

Ok, so here's an update of this issue being weird

  1. yesterday not only was tidyverse not loading, was having the same issue with kableExtra and here packages, all others shown in the screenshot worked fine.
  2. Opened a different .rmd file today, stored in a slightly different directory, and tidyverse loaded. So...
  3. Opened the file I'm currently working on and all library packages loaded with no issues.
  4. I have not done any other trouble shooting between posting this yesterday and now (closed R in frustration after making the above post and only opened it again 5 mins ago.
  5. To load my data I closed R and re-opened directly from the .rmd file that was having this issue and the same issue is happening again
  6. As the other .rmd file was still opened tried loading packages from there again and got the same error message.

So it might be a problem with the directory where the file is saved? Though I've never had this problem before and have .rmd files in a number of different folders for different projects.

Anyway, here's my YAML and the first couple code chunks. For some reason I'm getting an error message that it's invalid. Have checked it using yaml lint which tells it's valid so if you can spot an issue with it please let me know! I've tried a few variations of this but none seem to knit or render (trying it both as an .rmd and a .qmd). This is my first time writing a document in R from scratch and my supervisor is currently on holidays.


title: A Descriptive Analysis of How Psychology Journals Handle Post-Publication
Critiques
format:
pdf: default
journal: "sn-nature-human-behaviour"
keep-tex: true
author:

  • name: Author 1
    affiliations:
    • name: University of Melbounre
      id: 1
      department: Melbourne School of Psychological Sciences
      address: 161 Barry St
      city: Carlton
      state: VIC
      postal-code: 3010
      email: xxx@unimelb.edu.au
      corresponding: true
  • name: Author 2
    affiliations:
    • ref: 1
  • name: Author 3
    affiliations:
    • ref: 1
  • name: Author 4
    affiliations:
    • ref: 1
  • name: Author 5
    affiliations:
    • ref: 1
  • name: Author 6
    affiliations:
    • name: Stanford University
      id: 2
      department: Meta Research Innovation Centre
      address: 450 Jane Stanford Way
      city: Stanford
      state: CA
      postal-code: 94305
  • name: Author 7
    affiliations:
    • ref: 1
      abstract: >
      Fostering critical discussion is essential to upholding the ethos of
      science as an unbiased, collaborative, and self-correcting endeavor. Journals
      can support this by offering options for post-publication critique, such as
      commentaries or letters, allowing peers to voice substantiated concerns of
      empirical articles. We provide a descriptive, cross-sectional analysis of
      post-publication critique policies and prevalence across both prominent
      randomly-selected and psychology journals. We found that, overall, the
      majority of psychology journals do not offer explicit options for
      post-publication critique. When they did, length and time-to-submit limits
      were often not stated. Critique prevalence was rare with only a single event
      identified. Given the widespread recognition of the replication crisis in
      psychology, allowing avenues for criticisms to be voiced may help increase the
      credibility within the field. To support transparency and self-correction,
      psychology journals should offer clearly stated post-publication critique
      options and encourage their use.
      keywords:
  • metascience
  • post-publication critique
  • psychology
  • credibility
    bibliography: bibliography.bib

library(papaja) # article template
library(tidyverse)
library(ggplot2) # figure creation
library(RColorBrewer) # data visualisation
library(dplyr)
library(kableExtra) # for tables
library(knitr) # for literate programming
library(janitor) # for data munging
library(tidylog) # for inline code feedback
library(here) # for finding files
source(here('analysis','functions.R')) # load custom functions
source(here('analysis','raw_to_primary.R')) # converts raw data to primary data

Thank you!

Aha, I want a copy of that paper when it's done.

Can you give us the material in raw format, the visual editor format does not give a lot of information and it is not 'runable'.

I think we need to have something like this

---
title: "Basic Plot"
author: "Anon."
date: today
date-format: iso
number-sections: true
format: pdf
header-includes:
  - \usepackage{lipsum}
editor: visual
bibliography: "/home/john/RJunk/quarto/bibs/Roman.bib"
csl: "/home/john/RJunk/quarto/bibs/apa.csl"
---

# Start {#sec-start}

\lipsum[1]

```{r}
#| echo: false
#| label: fig-silly.plot
#| cap-location: margin

#| fig-cap: Amazingly Useless Plot.

library(ggplot2)
p1  <- ggplot(iris, aes(Sepal.Length, Sepal.Width))
p1

\lipsum[2]

When you are talking folders, are you talking about a "standard" folder or a Project folder? I have only been using project folders for a few months but I have had one go bad but only because it will not load. I have not lost anything it the folder.

I forgot to ask: Is this a .rmd or .qmd file?

1 Like

So, I've spent the last 2 days trying to fix this issue with my dad (who usually uses python) but things only seem to have gotten weirder. Now more packages are getting the error message. Also, when I load from the different file and do manage to get all the libraries to install, when I try to knit I still get the error that tidy verse is not installed which halts execution. My dad managed to get it kind of working on his computer using renv::restore() and then reinstalling some packages but this function won't run successfully for me.

This is a .rmd file. I've altered the YAML so that I could get it to knit (which it finally was earlier today... before it shat itself again). I uploaded to gitHub once I had the file kinda working, after it stopped I deleted the folder and redownloaded the whole repository but it's still having the same issue.

I'm about at the point where I just throw my laptop off a bridge and go live in the wilderness.


title: "A Descriptive Analysis of How Psychology Journals Handle Post-Publication Critiques"
author: "Author Names"
date: "r format(Sys.time(), '%d %B, %Y')"
output: pdf_document

#renv::activate()

library(papaja) # article template
library(tidyverse)
library(ggplot2) # figure creation
library(ggrepel) # for ggplot text labels
library(patchwork) # for multipanel plot layouts
library(RColorBrewer) # data visualisation
library(dplyr)
library(kableExtra) # for tables
library(knitr) # for literate programming
library(janitor) # for data munging
library(tidylog) # for inline code feedback
library(here) # for finding files

The YAML has the 3 dashes above and below as shown in your example... don't know how to get it to show that here. Keeps auto formatting it when I post. Kinda new to coding (in case that wasn't obvious!).

Really appreciate your trying to help! Thanks!

The YAML has the 3 dashes above and below as shown in your example...
Escape it with a backslash. \ . Only took me a year to learn this.

So far, I am getting some weird results so I have no idea what it going wrong. This is going to sound stupid but change the title? I am wondering if we have an invisible rouge character in there.

Other than that, I am at a loss. I think we need more code. Essentially, we need every bit of code you are writing. Try cutting out any " text" and giving us all the rest. BTW, I still want the paper. It looks fascinating.

As for wilderness, I can suggest some nice property not too far from Moosonee.

I finally solved it! I eventually uninstalled and reinstalled R and RStudio. Still had the same problem, asked phind.com (again) and it gave me this advice which actually worked! My code runs now. Still not sure why I had to install these things on my system to get it working as 1) they should have already been installed and 2) it was all working fine up until a few weeks ago but fixed now!

And yes, I will make sure to send you a link when we post a preprint of it. This was my 2023 honours thesis, really enjoyed it and found some interesting things (including certain publishers removing post-publication critique options).

Thanks again for your help! Will keep Moosonee in mind next time I have a meltdown :sweat_smile:

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.