I've been trying to automate a R script from months now on my Mac but with no success. The script is basically rendering a Rmarkdown website. I first tried with Automator (it failed), and now that macOS supports Shortcuts, I retried with Shortcuts (it fails too).
What's completely bizarre is that running the script from the Terminal is working perfectly fine – RMarkdown compiles the website. But when I try to run the exact same command (aka
Rscript compile.R) in Shortcuts, I receive an error message:
Can't rename columns that don't exist
Apparently it's a
dplyr error but once again, I don't understand where it comes from as the code runs perfectly when I compile the website in RStudio and manually from the Terminal.
Any clue what's going on? The script in question should run daily and having to do it manually is kind of pain.