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

An interactive learning widget for R using Quarto #204

Open
prupk opened this issue Feb 8, 2023 · 0 comments
Open

An interactive learning widget for R using Quarto #204

prupk opened this issue Feb 8, 2023 · 0 comments

Comments

@prupk
Copy link

prupk commented Feb 8, 2023

The following Test.Rmd will produce an interactive learning widget for [tag:R] using [tag:knitr] (see the link).

---
title: "Example Document"
author: "Your name here"
output:
  html_document:
    self_contained: false
---

```{r, include = FALSE}
tutorial::go_interactive()
```

By default, `tutorial` will convert all R chunks.

```{r}
a <- 2
b <- 3

a + b
```

Edited

Wondering how to an get an interactive learning widget for [tag:R] using [tag:quarto]. Need help for YAML of .qmd, my attempt is

    ---
title: "Test"
author: "MYaseen208"
format: 
  html:
    self_contained: false
---



```{r}
#| echo: false
#| include: false
tutorial::go_interactive()
```

```{r}
#| echo: false
1 + 1
```


You can add options to executable code like this 

```{r}
#| echo: false
2 * 2
```

The `echo: false` option disables the printing of code (only output is displayed).

However, it throws the following error:

ERROR: Validation of YAML front matter failed.
ERROR: (line 5, columns 3--7) Field "html" has empty value but it must instead be an object
4: format: 
5:   html:
        ~
6: ---

ERROR: Render failed due to invalid YAML.

Another attempt which render but don't produce the required output:

---
title: "Test1"
author: "MYaseen208"
format: 
  html:
    output-file: "Test1.html"
    self-contained: false
---
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

1 participant