-
Notifications
You must be signed in to change notification settings - Fork 286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Quarto R ojs_define function and OJS in RStudio #1242
Comments
ojs doesn’t currently work interactively within RStudio (you have to do a complete render). This will be improved in the future! |
Thanks a lot. Using some features of OJS (e.g. Inputs.range) is working with the complete render now, but when I try to define data in R, and then use it with OJS, it gives me OJS Runtime Error invalid module. In fact even with OJS defined data, it does not seem to be working. The following code gives OJS Runtime Error invalid module.
|
After updating my version, it seems to be working. Sorry for the confusion and thanks. |
I am sorry, but I have to reopen the issue. Below is a reprex. I can successfully define df in R. I can use the df in OJS, but I can't use the Plot module in RStudio. Is there a way to do that?
|
My guess is you are likely running an older version of RStudio. Try using one of the dailies, perhaps? |
I noticed something that seems slightly odd to me - the plot does not display in RStudio's Viewer panel, but when I click on the "Show in new window" button (a part of the Viewer panel), it opens a browser where the plot is displayed with no issues. In addition, I have done some experiments with d3, and it works with no problems even i RStudio Viewer panel. |
Ok, I see the issue. When using OJS, it's likely that you will run into modules that use modern JS syntax (such as the nullish coalescing operator Can you try using the Electron dailies instead? They're at the rightmost column of https://dailies.rstudio.com/ |
Thanks for the explanation, now I get it. I am afraid neither the Electron version is working. R Session Startup Failure ReportRStudio VersionRStudio 2022.07.0+547 "Spotted Wakerobin " (ec7dc45b, 2022-06-30) for Windows Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) RStudio/2022.07.0+547 Chrome/102.0.5005.63 Electron/19.0.4 Safari/537.36 Error message[No error available] Process OutputThe R session exited with code 1. Error output:
Standard output:
LogsC:/Users/novot/AppData/Local/RStudio/log/rsession-novot.log
|
I've contacted the IDE devs and will report back. |
Yes, I get the exact same behavior with the Quarto penguins example, almost two months later. RStudio 2022.07.1 Build 554, Windows 11. The issue is with the reactive plot in the Viewer with a rendered document. As noted above, it works fine in a browser (Microsoft Edge) after "Show in new window". A fresh install of RStudio on Linux gives the same error as on Windows. However, the viewer in Visual Studio Code works fine with both jupyter and r engines. A reactive table works perfectly in the RStudio Viewer , so the problem is localized to the reactive plot in RStudio Viewer. Thus, the penguins example in the Quarto docs will still fail for many users due to this issue. Another problem that is noted in a separate previous issue is that the example uses an altered version of the penguins.csv, but there is no link to download the custom file. This still has not been resolved, and the Quarto docs haven't been updated to reflect these known issues. |
@elbert5770 I'm sorry you hit this issue too. This is a combination of Observable JS source (which we don't control) and RStudio IDE (which has a different release schedule), and as a result it's outside the control of the quarto project. Please report this as an RStudio IDE bug at https://github.com/rstudio/rstudio. |
Can Quarto users somehow recommend to the Quarto team what to add to the documentation? Also, I fell like it would be best to close this issue and open a new one since my initial description is chaotic, which may confuse other users that encounter the issues mentioned above. |
I have the same problem. I downloaded the latest version of Rstudio, Quarto and R but I also get the
Session.info:
|
That function won't work if you execute it as part of just a cell (as it's only available during a render). This is a limitation we definitely hope to overcome at some point but for now that's the deal. |
This comment was marked as off-topic.
This comment was marked as off-topic.
@mcanouil this is also not stale as it's a feature request. Let's re-open and remove the stale tag |
Agreed! Also adding the "enhancement" label which is the proper label for feature requests. |
I tried to use Quarto to do data preprocessing in R and then make the created data available in OJS using RStudio, but it seems to me that the ojs_define function is not available. This article suggests that it might be possible, but it does not seem to be working for me.
In addition, it seems that using ojs from RStudio does not seem to be possible either. For example, following results in an error:
Is there a way to do what I tried above or will it be possible eventually?
The text was updated successfully, but these errors were encountered: