-
DescriptionI am attempting to use
Here is the sample script I was attempting to render: # %% [markdown]
# ---
# title: A test
# author: A reporter
# jupyter: ark
# ---
# %%
#| echo: true
#| output: false
library(tidyverse)
# %%
#| echo: false
#| output: asis
knitr::kable(head(iris))
# %% [markdown]
# Some markdown
# %%
#| echo: false
#| fig-width: 4
#| fig-cap: A plot
ggplot(iris) + geom_point(aes(x = Sepal.Length, y = Sepal.Width, color = Species)) And here is a fragment of rendered output: ![]() |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 7 replies
-
Did you try using a plain Quarto document instead? Side note: |
Beta Was this translation helpful? Give feedback.
-
Thanks for the message - You're hitting a number of relatively obscure code paths here (rendering .R scripts, using jupyter to render R, and using non-ipynb files to render jupyter notebooks). We should make sure this works, but I'm not too surprised something is going wrong.
Edit: Jonathan assures me |
Beta Was this translation helpful? Give feedback.
-
@cscheid Thank you for the reply! From your answer I gather that rendering R scripts using Jupyter is still an experimental feature. It would be a great tool for those of us who develop scripts incrementally and where RMarkdown is not an appropriate format, so it is exciting to see work being done in this direction. Regarding I will open an issue shortly! |
Beta Was this translation helpful? Give feedback.
-
I've just tried a plain Quarto document. Quarto does detect the kernel ( ---
title: "Reproducible Quarto Document"
format: html
engine: jupyter
jupyter: ark
---
```{r}
x <- c(1, 2, 3, 4, 5)
y <- c(1, 4, 9, 16, 25)
plot(x, y)
```
```{r}
#| output: asis
cat("This is a **markdown** document.")
```
Quarto 1.7.21
[✓] Checking Python 3 installation....OK
Version: 3.13.2
Path: /usr/local/python/current/bin/python3
Jupyter: 5.7.2
Kernels: julia-1.11, ark, python3
[✓] Checking Jupyter engine render....OK
![]() Same behaviour using an R script. # %% [markdown]
# ---
# title: "Reproducible Quarto Document"
# format: html
# engine: jupyter
# jupyter: ark
# keep-ipynb: true
# ---
# %%
x <- c(1, 2, 3, 4, 5)
y <- c(1, 4, 9, 16, 25)
plot(x, y)
# %%
#| output: asis
cat("This is a **markdown** document.") Note that I can reproduce the markdown table output from I've simplified the code to avoid the base64 encoded image. # %% [markdown]
# ---
# title: A test
# engine: jupyter
# jupyter: ark
# keep-ipynb: true
# ---
# %%
#| echo: false
#| output: false
library(knitr)
# %%
#| echo: false
#| output: asis
knitr::kable(head(iris))
# %%
#| echo: false
#| output: asis
cat("Some **markdown** text _formatted_ with `rmarkdown` and **knitr**.") ![]() The notebook: {
"cells": [
{
"cell_type": "markdown",
"id": "48300306",
"metadata": {},
"source": [
"---\n",
"title: A test\n",
"engine: jupyter\n",
"jupyter: ark\n",
"keep-ipynb: true\n",
"---"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "207f446e",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"- Project '/workspaces/quarto-codespaces' loaded. [renv 1.1.4]\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"- The project is out-of-sync -- use `renv::status()` for details.\n"
]
}
],
"source": [
"#| echo: false\n",
"#| output: false\n",
"library(knitr)"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "26669104",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"\n",
"\n",
"| Sepal.Length| Sepal.Width| Petal.Length| Petal.Width|Species |\n",
"|------------:|-----------:|------------:|-----------:|:-------|\n",
"| 5.1| 3.5| 1.4| 0.2|setosa |\n",
"| 4.9| 3.0| 1.4| 0.2|setosa |\n",
"| 4.7| 3.2| 1.3| 0.2|setosa |\n",
"| 4.6| 3.1| 1.5| 0.2|setosa |\n",
"| 5.0| 3.6| 1.4| 0.2|setosa |\n",
"| 5.4| 3.9| 1.7| 0.4|setosa |"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#| echo: false\n",
"#| output: asis\n",
"knitr::kable(head(iris))"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "9b0cc8e0",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Some **markdown** text _formatted_ with `rmarkdown` and **knitr**."
]
}
],
"source": [
"#| echo: false\n",
"#| output: asis\n",
"cat(\"Some **markdown** text _formatted_ with `rmarkdown` and **knitr**.\")"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Ark R Kernel",
"language": "R",
"name": "ark",
"path": "/home/vscode/.local/share/jupyter/kernels/ark"
},
"language_info": {
"file_extension": ".R",
"mimetype": "text/r",
"name": "R",
"positron": {
"continuation_prompt": "+ ",
"input_prompt": "> "
},
"version": "R version 4.4.3 (2025-02-28)"
}
},
"nbformat": 4,
"nbformat_minor": 5
} Environnement:
|
Beta Was this translation helpful? Give feedback.
@tzakharko Let's discuss on the opened issue now.