https://github.com/kamapu/yamlme
R-Package for writing R-markdown documents from plain R code.
https://github.com/kamapu/yamlme
documentation rmarkdown yaml
Last synced: 4 months ago
JSON representation
R-Package for writing R-markdown documents from plain R code.
- Host: GitHub
- URL: https://github.com/kamapu/yamlme
- Owner: kamapu
- License: gpl-3.0
- Created: 2020-09-22T18:22:40.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2024-06-25T10:18:04.000Z (almost 2 years ago)
- Last Synced: 2026-01-28T05:24:01.686Z (5 months ago)
- Topics: documentation, rmarkdown, yaml
- Language: R
- Homepage: https://kamapu.github.io/yamlme/
- Size: 5.04 MB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
README
---
output:
github_document:
html_preview: false
---
```{r,echo=FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/"
)
```
# yamlme
[](https://cran.r-project.org/web/checks/check_results_yamlme.html)
[](https://cran.r-project.org/package=yamlme)
[](https://zenodo.org/badge/latestdoi/297735831)
[](https://github.com/kamapu/yamlme/actions)
[](https://codecov.io/gh/kamapu/yamlme?branch=master)
[](https://cran.r-project.org/package=yamlme)
[](https://cran.r-project.org/package=yamlme)
[](https://github.com/kamapu/yamlme/actions/workflows/R-CMD-check.yaml)
## Installing yamlme
You can install the last release from CRAN
```{r eval=FALSE}
install.packages("yamlme", dependencies = TRUE)
```
or the current development version from GitHub, using the package `devtools`:
```{r eval=FALSE}
library(devtools)
install_github("kamapu/yamlme", build_vignettes = TRUE)
```
After installing the package have to be loaded in the current R-session.
```{r}
library(yamlme)
```
## Create a document
This package aims to save documents with their respective settings (yaml-head)
in R-objects.
```{r}
my_document <- list(
title = "Mi First Document",
author = "My Name",
output = "html_document",
body = txt_body(
"# Starting a working day",
"",
"At the beginning of every day I will do:",
"",
"- Say everyone \"Good morning!\"",
"- Start the coffe mashine",
"- Start the computer",
"- Read mails"
)
)
my_document <- as(my_document, "rmd_doc")
my_document
```
By this way it is possible to produce documents from plain R-code. This
document can be then rendered by the function `render_rmd()`.
```{r eval = FALSE}
render_rmd(input = my_document)
browseURL("my_document.html")
```
For more details, take a look on the vignette.
```{r eval = FALSE}
vignette("yamlme-intro")
```
## Similar packages
The package [`ymlthis`](https://github.com/r-lib/ymlthis) is targeting the
same tasks but using a different approach for it.
The most important dependencies of `yamlme` are
[`yaml`](http://biostat.app.vumc.org/wiki/Main/YamlR) and
[`rmarkdown`](https://rmarkdown.rstudio.com/).