Skip to content

Commit

Permalink
Update previews
Browse files Browse the repository at this point in the history
  • Loading branch information
DesiQuintans committed Sep 27, 2023
1 parent 21a6d60 commit c6e9e91
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 0 deletions.
25 changes: 25 additions & 0 deletions readme_files/Theme_preview.R
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).")
}
}
53 changes: 53 additions & 0 deletions readme_files/Theme_preview.Rmd
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).")
}
}
```




Binary file added readme_files/preview_r.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added readme_files/preview_rmd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c6e9e91

Please sign in to comment.