-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.Rmd
executable file
·100 lines (78 loc) · 2.84 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
---
output:
github_document:
html_preview: false
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
<!-- Use snippet 'render_markdown' for it -->
```{r,echo=FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/"
)
```
# yamlme
<!-- badges: start -->
[![cran checks](https://badges.cranchecks.info/worst/yamlme.svg)](https://cran.r-project.org/web/checks/check_results_yamlme.html)
[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/yamlme)](https://cran.r-project.org/package=yamlme)
[![DOI](https://zenodo.org/badge/297735831.svg)](https://zenodo.org/badge/latestdoi/297735831)
<br>
[![R-CMD-check](https://github.com/kamapu/yamlme/workflows/R-CMD-check/badge.svg)](https://github.com/kamapu/yamlme/actions)
[![Codecov test coverage](https://codecov.io/gh/kamapu/yamlme/branch/master/graph/badge.svg)](https://codecov.io/gh/kamapu/yamlme?branch=master)
[![CRAN_downloads](http://cranlogs.r-pkg.org/badges/yamlme)](https://cran.r-project.org/package=yamlme)
[![total downloads](http://cranlogs.r-pkg.org/badges/grand-total/yamlme)](https://cran.r-project.org/package=yamlme)
[![R-CMD-check](https://github.com/kamapu/yamlme/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/kamapu/yamlme/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->
## 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/).