-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTheme_preview.Rmd
54 lines (40 loc) · 1.29 KB
/
Theme_preview.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
---
title: "R Notebook"
output:
html_document:
df_print: paged
---
# This is a preview of the theme
Lorem ipsum **dolor sit amet**, consectetur adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
exercitation ullamco laboris _nisi ut aliquip_ ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in `voluptate velit esse` cillum dolore eu
fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa
qui officia deserunt mollit [anim id est](http://www.test.com) laborum.
<http://www.google.com>
> An inline block-quote.
```{r folded_block}
# This block should be folded for the screenshot.
```
```{r blockname, echo=TRUE, eval=FALSE}
#' Mirror the rows/cols of a matrix
#'
#' @param mat (Matrix) A matrix.
#' @param MARGIN (Integer) `1` to reverse order of cols, `2` to reverse rows.
#'
#' @return A mirrored matrix.
#' @export
#'
#' @md
mirror_matrix <- function(mat, MARGIN = 2) {
# Here's an inline comment.
new_order <- dim(mat)[MARGIN]:1
if (MARGIN == 1 | MARGIN == TRUE) {
mat[new_order, ]
} else if (MARGIN == 2) {
mat[, new_order]
} else {
stop("Argument 'MARGIN' must be set to either '1' (rows) or '2' (cols).")
}
}
```