考虑以下文档:
---
title: "Untitled"
format: pdf
jupyter: r-reticulate
---
```{python}
%load_ext rpy2.ipython
```
呈现时,会产生以下错误:
An error occurred while executing the following cell:
------------------
%load_ext rpy2.ipython
------------------
所以我的问题是:Quarto能够用ipython
魔术渲染文档吗?
我刚刚发现,它的工作,如果我使用{ipython}
而不是{python}
:
---
title: "Untitled"
format: pdf
jupyter: r-reticulate
---
```{ipython}
%load_ext rpy2.ipython
```
编辑
在@shafee(我非常感谢他)的帮助下,发现quarto
可以使ipython
变魔术。虽然rpy2
安装在r-reticulate
环境中,但还是出现了问题。然而,在默认的python
环境中安装了rpy2
之后,这个问题就消失了,即使在使用r-reticulate
环境时也是如此。
这很奇怪,并且已经提出了一个问题:
https://github.com/quarto-dev/quarto/issues/53