-
DescriptionHi, i want to add tabs in Quarto. I will have 8 tabs, so i decide to make aloop in order to generate sections of text and print a dotplot under each tab. I try the following code. The code must print dotplot under each tab
Nothing is displayed when using this code. Can you please tell me where there is an error? |
Beta Was this translation helpful? Give feedback.
Answered by
mcanouil
Apr 25, 2024
Replies: 1 comment 2 replies
-
Your code is not valid:
---
format: html
---
Below are tables of the first six rows of the Palmer penguins dataset by species:
::: {.panel-tabset}
```{r}
#| echo: false
#| output: asis
library(palmerpenguins)
cat(
sprintf(
"- `%s` (@tbl-%s)",
levels(penguins[["species"]]),
levels(penguins[["species"]])
),
sep = "\n"
)
for (ispecies in levels(penguins[["species"]])) {
tab <- penguins |>
dplyr::filter(species %in% ispecies) |>
dplyr::select(-species) |>
head() |>
knitr::kable()
cat(sprintf("\n## %s\n", ispecies))
print(tab)
}
```
:::
More:
|
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
mcanouil
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Your code is not valid: