generated from DesiQuintans/RStudioThemeTemplate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
21a6d60
commit c6e9e91
Showing
4 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
|
||
# Section header ---------------------------------------------------------- | ||
|
||
#' 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).") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
--- | ||
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 with a *bold comment* and _italic 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).") | ||
} | ||
} | ||
``` | ||
|
||
|
||
|
||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.