nrennie / nrennie.github.io-comments

Repository to host Utterances for blog.
2 stars 0 forks source link

blog/combining-r-and-python-with-reticulate-and-quarto/ #1

Open utterances-bot opened 1 year ago

utterances-bot commented 1 year ago

Combining R and Python with {reticulate} and Quarto | Nicola Rennie

Sometimes you might need to use R. Sometimes you might need to use Python. Sometimes you need to use both at the same time. This blog post shows you how to combine R and Python code using {reticulate} and output the results using Quarto.

https://nrennie.rbind.io/blog/combining-r-and-python-with-reticulate-and-quarto/

fjodor commented 1 year ago

Thanks for the post! Nice to see some quarto tricks in action, e. g. output-location: slide.

bassamsdata commented 1 year ago

So, everytime I ask AI search chats about quarto and Python, it directs me to this blog article, which is fantastic. This is the third time I've looked for quarto and python and come upon this site. It's a fantastic blog article that the official quarto website should link to. Thank you for writing this great article.

nrennie commented 1 year ago

Thanks - I'm glad you found it useful!

ndjrt commented 1 year ago

So when I try to run the qmd file, I get the following error for the r chunk where the reticulate library is loaded.

Any suggestions to get it to work?

Error in fortify(): ! data must be a , or an object coercible by fortify(), not a list. Backtrace:

  1. ggplot2::ggplot(...)
  2. ggplot2:::ggplot.default(...)
  3. ggplot2:::fortify.default(data, ...)
nrennie commented 1 year ago

Hi @ndjrt, do you mean the code chunk labelled label: plotting? I can't reproduce the error unfortunately. Is reticulate properly installed, and can you inspect the output from the python block to make sure it looks as you would expect?