Open Pica-hudsonia opened 1 year ago
Pica-hudsonia, as an R user, I was wondering if you could help me out figuring out how to make the "Execute Code" plugin for Obsidian work. This may be a totally newbie question, but I'm not sure what I'm supposed to put into the "R arguments" settings. The plugin author encouraged me to check in what other R users were doing. I hope you don't mind.
Have you got an Rscript binary on your system? If that path (found using which Rscript
) is put into the Rscript path in the settings, then running your R code should work. Is it something more advanced you're having problems with?
Hi @Josefmo! No worries! I'm still figuring this out myself.
I don't input anything into the "R arguments" section. I agree with the previous commentor, make sure you have R downloaded (https://www.r-project.org).
Next open up your terminal app and use where Rscript
for macOS and Windows or which Rscript
to find it on linux. Put that path into the "Rscript path" field in the R settings.
If that doesn't work, could you let me know what specific problem you're facing and the error you're getting? Also, what is your use case? The RStudio app is a really easy to use alternative if you are just looking to format and an run your code in a markdown formated file.
Hello! I've really been loving this plugin, but I've run into a consistent problem where my code will output things unnecessarily unless I add a print command at the end.
For instance, the following code outputs the dataframe as a vector:
I am able to suppress the output by adding
invisible(capture.output())
around the entire code creating the dataframe. However, in this chunk,It will output the formatted results of the summary function and then just the unformatted summary function (see end of comment).
The easiest way I've found to fix this is to add
print(" ")
to the end of my code chunks, which prevents the unwanted information from being printed. Is there a better way to deal with this? Is this a genuine bug?I'm on an M1 Pro Macbook running macOS 13.2.1
Problematic output example