File: example1.md

package info (click to toggle)
r-cran-simplermarkdown 0.0.6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 392 kB
  • sloc: makefile: 2
file content (74 lines) | stat: -rw-r--r-- 1,136 bytes parent folder | download
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
---
title: Title
---


# Header

- List item 
- Another list item

And some text with `inline code`.

``` {#codeblock1 .R echo=TRUE results=TRUE additionalargument=42}
a <- 1+1
b <- mean(a) + 10
# Dit is commentaat
c <- a+b
c
dta <- iris
```

And some text

``` {.R fun=output_table caption="Sample iris"}
dta$foo <- dta$Sepal.Width/dta$Sepal.Length
dta[1:20, ]
```

### And some text

The mean of `Sepal.Width` is `m<-round(mean(dta$Sepal.Width), 2)`{.R}. 
This is `ifelse(m>2, "larger", "smaller")`{.R} than 2.

```
Geen R-code
```


```{.R fun=output_figure name="test" caption="My figure" device="pdf" width=8 
  height=6}
warning("FOO")
plot(dta$Sepal.Width, dta$Petal.Width)
```


```{.R fun=output_raw}
md_figure({
plot(dta$Sepal.Length, dta$Petal.Length)
}, name = "foo")
```


# Some regresion like tests

Following should result in no code block.

```{.R #nooutput1 results=FALSE echo=FALSE}
a <- 1+1
a
```

Following should result in an empty code block.

```{.R #nooutput2 results=FALSE echo=FALSE drop_empty=FALSE}
a <- 1+1
a
```

Following code should not be run

```{.R #dontrun eval=FALSE}
stop("Dit is een error")
```