Skip to content
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

I very much like the purpose of this plug-in #3

Open
erex opened this issue Nov 28, 2024 · 16 comments
Open

I very much like the purpose of this plug-in #3

erex opened this issue Nov 28, 2024 · 16 comments

Comments

@erex
Copy link

erex commented Nov 28, 2024

I write R-code and Quarto documents almost daily. Same for Obsidian; appreciate effort bring them together.

However, I cannot make the plugin work on my Windows 11 machine. I have installed previous versions of the plugin and today installed version 0.1.1. I'm using it with R 4.4.2 and Quarto 1.6.38. I am confident I have properly specified paths (and consulted issue #1 closed two weeks ago.

C:\Program Files\R\R-4.4.2\bin\x64\R.exe
C:\Program Files\quarto\bin\quarto.exe

I don't need htmlwidgets at the moment, so not interested in Pandoc, but have configured it nonetheless
C:\Program Files\Pandoc\pandoc.exe

Working with a simple file with a single code chunk to create a histogram,
image

this is what the console shows:
image

Attempting a Quarto html render of the same file produces this at the console
image

Below is raw file:

---
title: Ridian2
format: html
date: 2024-11-28
author: Eric
---
# Second attempt
Simply trying to get simple R code to function

```r
#| label: 4e074085
hist(runif(1000))
```

The above should have produced a histogram of uniformly distributed random variates.

You can see Ridian adds a label to the code chunk, but nothing else.

I appreciate your help.

@MichelNivard
Copy link
Owner

Hi Eric, took me a while to debug! So the quarto doc you share didnt run for me either, while others did. The label needs to be a string, which it is (see the is an e in there) but its not recognised as such by quarto, I think that might actually be a quarto bug so I'll open an issue with quarto and implement a quick patch for Ridian. This leaves R not running. The console is being crowded by to many logs from the autocomplete code, that's totally my fault, ill patch the logging so we can figure out the other issue for you.

@erex
Copy link
Author

erex commented Nov 28, 2024

very nice of you to have a look at my dual problems. I'm running fairly new release of Quarto, maybe that's part of the story. Standing by to hear more about the patch to the logging

@MichelNivard
Copy link
Owner

for us to confirm the quarto issue is really this issue while we wait for the quarto ppl to respond, can you try and render with "hello" as the label (no quotes)? if that works then i can focus on the other issue

@erex
Copy link
Author

erex commented Nov 28, 2024

Your experiment with hello as the label, does indeed succeed in rendering an HTML file in my Obsidian/exports folder
image

@MichelNivard
Copy link
Owner

are the following R packages installed on your machine?

install.packages(evaluate)
install.packages(jsonlite)
install.packages(htmlwidgets)
install.packages(languageserver)

@MichelNivard
Copy link
Owner

note language server is new I hadnt updated the readme.md, just the website.

@erex
Copy link
Author

erex commented Nov 28, 2024

No, I was missing evaluate and languageserver

I've installed those packages, closed and reopened Obsidian, but still Ridan doesn't run the code chunk when asked.

Does it matter if RStudio is running at the same time, I presume Ridian creates a new instance of R for its own purposes.

@MichelNivard
Copy link
Owner

It certainly has its own instance yes. Do you get autocomplete/function suggestions when the cursor is within a function like the one I pasted here:

image

@erex
Copy link
Author

erex commented Nov 28, 2024

yes, I do get autocomplete suggestions in a new chunk that I created within the same Obsidian document. When I hit Run chunk I get a label manufactured, but no output.

A side note: Your step 5 about installing packages missed my attention on first reading. This is because it was down below BRAT instructions. My brain shut off when I encountered BRAT instructions because I (incorrectly) assumed everything following that was out-of-date now that the plugin has been approved and BRAT was no longer necessary. Simply my habits as an impatient reader.

@MichelNivard
Copy link
Owner

So R works for sure, otherwise there is no autocomplete. can you try and run code that outputs text but not a plot?

‘’’r
1+2
‘’’

does it output a result?

Can you ask for a help page:

‘’’r
?hist()
‘’’

typing on my phone these might not be backticks but u think you get the point.

@erex
Copy link
Author

erex commented Nov 28, 2024

Understand your instructions,

No luck on either count
image

You're very tenacious about this.

@MichelNivard
Copy link
Owner

Thanks this is the info I needed to narrow down where the issue lies, I have a win 11 test setup I can see about reproducing and then fixing the issue. Can you share the other plugins you use, these things can sometimes be plugin conflicts…

@erex
Copy link
Author

erex commented Nov 29, 2024

Thanks Professor. I have quite a large assortment (67) of installed plugins.

I don't know of a text-based way to show installed plugins, using this clumsy method
image
image

@MichelNivard
Copy link
Owner

So, I installed those that are available on the plugin "store", simply enabling those on win 11, then disabling and enabling Ridian I cant reproduce your failure. Given many of these plugins aren't on the store (you might have gotten them elsewhere, or they aren't being maintained anymore). I will fix the issue with the autocomplete excessively logging so you can at least see whats going on while the plugin tries to run R code and we can see if there is some kind of Ridian problem I can solve, but I cant realistically test for all possible plugin conflicts. Given R runs, and the autocomplete works, perhaps its some kind of callout (results should be printed to a callout)/code related plugin getting in the way? You can expect the update that fixes the console being flooded to be life before Monday.

@erex
Copy link
Author

erex commented Nov 29, 2024

Understand you can't test for all conflicts. My plugin addiction is a bit extreme. I will try to do some plugin pruning at the weekend, and will let you know if there are useful developments. Thanks again for your help.

@erex
Copy link
Author

erex commented Nov 29, 2024

I too will leave this issue for the weekend. I have disabled (not uninstalled) all plugins with the exception of Ridian and still am unable to get an R code chunk to run.

The console does show this complaint regarding sqlite and the Zotero plugin (even with the plugin disabled). Afraid that is all the news I can report
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants