Sfoglia il codice sorgente

Render R code in skeleton when pkg is installed (#55)

tags/v0.4.0
Garrick Aden-Buie 5 anni fa
parent
commit
4902390cc2
Nessun account collegato all'indirizzo email del committer
2 ha cambiato i file con 12 aggiunte e 6 eliminazioni
  1. +4
    -0
      NEWS.md
  2. +8
    -6
      inst/rmarkdown/templates/xaringanthemer/skeleton/skeleton.Rmd

+ 4
- 0
NEWS.md Vedi File

a corresponding CSS rule setting the `font-weight` property of `<strong>` a corresponding CSS rule setting the `font-weight` property of `<strong>`
elements (thanks @matiasandina, #50). elements (thanks @matiasandina, #50).
* The xaringanthemer slide skeleton (R Markdown template) will now render when
packages that are used in the template but not in xaringanthemer's Imports are
not installed (#52).

* Set slide number font size in `rem` so that increasing the font size at the * Set slide number font size in `rem` so that increasing the font size at the
slide level doesn't result in giant slide numbers (#53). slide level doesn't result in giant slide numbers (#53).



+ 8
- 6
inst/rmarkdown/templates/xaringanthemer/skeleton/skeleton.Rmd Vedi File

echo = TRUE, echo = TRUE,
message = FALSE, message = FALSE,
warning = FALSE, warning = FALSE,
fig.show = TRUE,
fig.showtext = requireNamespace("showtext", quietly = TRUE),
hiline = TRUE hiline = TRUE
) )
``` ```


--- ---


```{r message=TRUE}
```{r message=TRUE, eval=requireNamespace("cli", quietly = TRUE)}
cli::cli_alert_success("It worked!") cli::cli_alert_success("It worked!")
``` ```


## Tables ## Tables


--- ---
exclude: `r if (requireNamespace("tibble", quietly=TRUE)) "false" else "true"`


```{r}
```{r eval=requireNamespace("tibble", quietly=TRUE)}
tibble::as_tibble(mtcars) tibble::as_tibble(mtcars)
``` ```


``` ```


--- ---
exclude: `r if (requireNamespace("DT", quietly=TRUE)) "false" else "true"`


```{r}
```{r eval=requireNamespace("DT", quietly=TRUE)}
DT::datatable(head(mtcars), fillContainer = FALSE, options = list(pageLength = 4)) DT::datatable(head(mtcars), fillContainer = FALSE, options = list(pageLength = 4))
``` ```




--- ---


```{r plot-example}
```{r plot-example, eval=requireNamespace("ggplot2", quietly=TRUE)}
library(ggplot2) library(ggplot2)
(g <- ggplot(mpg) + aes(hwy, cty, color = class) + geom_point()) (g <- ggplot(mpg) + aes(hwy, cty, color = class) + geom_point())
``` ```


--- ---


```{r plot-example-themed}
```{r plot-example-themed, eval=requireNamespace("ggplot2", quietly=TRUE)}
g + xaringanthemer::theme_xaringan(text_font_size = 16, title_font_size = 18) + g + xaringanthemer::theme_xaringan(text_font_size = 16, title_font_size = 18) +
ggtitle("A Plot About Cars") ggtitle("A Plot About Cars")
``` ```

Loading…
Annulla
Salva