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

[feature] - incremental R output separate from code #375

Open
Shaunson26 opened this issue May 16, 2024 · 1 comment
Open

[feature] - incremental R output separate from code #375

Shaunson26 opened this issue May 16, 2024 · 1 comment

Comments

@Shaunson26
Copy link

Is it possible to have incremental output chunks? I like to explain the code before revealing the output. Thus, I am often writing

```{r, eval=F}
#some code
``` 

--

```{r, echo=F}
#the same code
```

By filing an issue to this repo, I promise that

  • [ x] I have fully read the issue guide at https://yihui.org/issue/.
  • [ x] I have provided the necessary information about my issue.
    • If I'm asking a question, I have already asked it on Stack Overflow or RStudio Community, waited for at least 24 hours, and included a link to my question there.
    • If I'm filing a bug report, I have included a minimal, self-contained, and reproducible example, and have also included xfun::session_info('xaringan'). I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version: remotes::install_github('yihui/xaringan').
    • If I have posted the same issue elsewhere, I have also mentioned it in this issue.
  • [ x] I have learned the Github Markdown syntax, and formatted my issue correctly.

I understand that my issue may be closed if I don't fulfill my promises.

@SNAnalyst
Copy link

It is not the solution you were looking for, but I will often use a tabbed slide for this.
So, I'll have one tab that I label "R code" and that has the R code and any annotations I want to present/discuss. Next to that I'll have a tab called "output" that shows the output from the code.
This has the advantage of allowing for even more tabs, for example a tab with improved/alternative code, etc.

It's not exactly what you requested, but it works very well for me and it doesn't require a new feature in Xaringan.

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

2 participants