ojs code chunks not working quarto

Hi, I've just today updated to Rstudio "Spotted Wakerobin" Release (e7373ef8, 2022-09-06) for macOS and am trying to run comparisons between ggplot and ojs. However when I change a r code chunk to ojs, the code chunk arrows on the right are removed and when I press cmd+shft+enter, I get the following error - /bin/sh: ojs: command not found. I found a windows problem and its solution, but it was specifically for the windows terminal, not Mac Rstudio code chunks.

I thought Quarto and Observable JS were part of the main Rstudio desktop download now. I also separately installed Quarto today, but that didn't cause ojs to become executable within a code chunk.

Any help please!

From the terminal pane in RStudio (not iTerm2 or another application)

which ojs

If it’s missing, install. If it’s in a different directory, modify $PATH env

I've just typed which ojs and there's nothing returned. However, I just installed quarto from quarto.org and still nothing.

Update, operator error! Haha.

Apparently OJS doesn’t run within Quarto interactively in code chunks like R or Python, it only runs when you render the document. When I rendered my doc, I got the ggplot and OJS plot as expected.

Only downside now is it seems very cumbersome to iterate on an OJS plot if you have to render every time you make a tweak.

1 Like

For the benefit of the curious, ojs is not included in Quarto, and looks to be a heavy lift if this is the Open Journal System suite

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.

I'll try to add to the answers above so that correct information are shared.

ojs is not a program. It refers to Observable JS, and this could is documented on Quarto Website

So nothing at all to do with the link share above, or Open Journal System suite

Yes currently it works that way - See issue

it does not work interactively in Notebook mode.

1 Like