Automating Rscript in macOS with Shortcuts keeps failing

Hi there,

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.

Thanks!

Still investigating what's going on but apparently, the issue could come from an XLSX file. Once again, I don't understand why/how considering the same XLSX file is perfectly imported when I run the script from the Terminal and/or RStudio.

Can you run a hello_world.R script?

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.