-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
13 changed files
with
219 additions
and
7 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,100 @@ | ||
--- | ||
title: Template for using R 'xaringan' package in a 'rosr' project | ||
output: beamer_presentation | ||
always_allow_html: yes | ||
--- | ||
|
||
```{r md-hint, include=FALSE} | ||
# Markdown Syntax | ||
# - *italic*, **bold**, `code`, ~subscript~, ^superscript^, > quote, ^[footnote] | ||
# - $inline equation$, $$display equation$$ | ||
# - \begin{equation} (\#eq:eq-label)\end(equation), \@ref(eq:eq-label) | ||
# - [@bib-entry1; @bib-entry2] | ||
# - [](hyperlink) | ||
# - ![](image link), knitr::include_graphics(), \@ref(fig:fig1) | ||
# - knitr::kable(), \@ref(tab:tab1) | ||
``` | ||
|
||
|
||
```{r, include=FALSE} | ||
options(htmltools.dir.version = FALSE) | ||
``` | ||
|
||
# Introduction | ||
|
||
This template comes from the R 'xaringan' package and modified by Peng Zhao. It intends to show how to cross refer other files in a 'rosr' project, rather than to show how to use the original template. | ||
|
||
--- | ||
|
||
# Methods | ||
|
||
## Set up | ||
|
||
Firstly, we switch off the codes and message display in a manuscript, and set the working directory to the rosr project. | ||
|
||
```{r setup} | ||
oldwd <- getwd() | ||
knitr::opts_chunk$set(echo = TRUE, warning = FALSE, message = FALSE) | ||
knitr::opts_knit$set(root.dir = dirname(dirname(oldwd))) | ||
``` | ||
|
||
--- | ||
|
||
## Load data | ||
|
||
Now we can use the relative path. Let's sync the bib file and run an R script. | ||
|
||
```{r load, results='hide'} | ||
source('R/rosr.R') | ||
``` | ||
|
||
--- | ||
|
||
## Numbers | ||
|
||
As we just ran the `source()` command, we can use the results from the `R/rosr.R`. For example, the mean temperature is `r temperature` degree. | ||
|
||
--- | ||
|
||
## Tables | ||
|
||
We could insert a table. | ||
|
||
|
||
```{r} | ||
aq$Month <- as.factor(aq$Month) | ||
DT::datatable( | ||
aq, | ||
fillContainer = FALSE, options = list(pageLength = 4) | ||
) | ||
``` | ||
|
||
--- | ||
|
||
## Figures | ||
|
||
Plot the data in a diagram. | ||
|
||
```{r fig-lab, fig.cap='Air quality data.'} | ||
plot(aq) | ||
``` | ||
|
||
--- | ||
|
||
We could insert an image. | ||
|
||
```{r img-lab, fig.cap='Insert an image.'} | ||
knitr::include_graphics(paste0(getwd(), '/image/rosr_R.png')) | ||
``` | ||
|
||
--- | ||
|
||
## Equations | ||
|
||
Use the `rosr::eq()` function to insert an equation. See Eq. \@ref(eq:sd) | ||
|
||
```{r, results='asis'} | ||
eqs <- 'equation/rosr-eq.Rmd' | ||
rosr::eq(eqs, label = 'sd') | ||
``` |
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,4 @@ | ||
name: beamer Presentation | ||
description: > | ||
Create a beamer | ||
create_dir: false |
100 changes: 100 additions & 0 deletions
100
inst/rmarkdown/templates/powerpoint/skeleton/skeleton.Rmd
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,100 @@ | ||
--- | ||
title: Template for using R 'xaringan' package in a 'rosr' project | ||
output: powerpoint_presentation | ||
always_allow_html: yes | ||
--- | ||
|
||
```{r md-hint, include=FALSE} | ||
# Markdown Syntax | ||
# - *italic*, **bold**, `code`, ~subscript~, ^superscript^, > quote, ^[footnote] | ||
# - $inline equation$, $$display equation$$ | ||
# - \begin{equation} (\#eq:eq-label)\end(equation), \@ref(eq:eq-label) | ||
# - [@bib-entry1; @bib-entry2] | ||
# - [](hyperlink) | ||
# - ![](image link), knitr::include_graphics(), \@ref(fig:fig1) | ||
# - knitr::kable(), \@ref(tab:tab1) | ||
``` | ||
|
||
|
||
```{r, include=FALSE} | ||
options(htmltools.dir.version = FALSE) | ||
``` | ||
|
||
# Introduction | ||
|
||
This template comes from the R 'xaringan' package and modified by Peng Zhao. It intends to show how to cross refer other files in a 'rosr' project, rather than to show how to use the original template. | ||
|
||
--- | ||
|
||
# Methods | ||
|
||
## Set up | ||
|
||
Firstly, we switch off the codes and message display in a manuscript, and set the working directory to the rosr project. | ||
|
||
```{r setup} | ||
oldwd <- getwd() | ||
knitr::opts_chunk$set(echo = TRUE, warning = FALSE, message = FALSE) | ||
knitr::opts_knit$set(root.dir = dirname(dirname(oldwd))) | ||
``` | ||
|
||
--- | ||
|
||
## Load data | ||
|
||
Now we can use the relative path. Let's sync the bib file and run an R script. | ||
|
||
```{r load, results='hide'} | ||
source('R/rosr.R') | ||
``` | ||
|
||
--- | ||
|
||
## Numbers | ||
|
||
As we just ran the `source()` command, we can use the results from the `R/rosr.R`. For example, the mean temperature is `r temperature` degree. | ||
|
||
--- | ||
|
||
## Tables | ||
|
||
We could insert a table. | ||
|
||
|
||
```{r} | ||
aq$Month <- as.factor(aq$Month) | ||
DT::datatable( | ||
aq, | ||
fillContainer = FALSE, options = list(pageLength = 4) | ||
) | ||
``` | ||
|
||
--- | ||
|
||
## Figures | ||
|
||
Plot the data in a diagram. | ||
|
||
```{r fig-lab, fig.cap='Air quality data.'} | ||
plot(aq) | ||
``` | ||
|
||
--- | ||
|
||
We could insert an image. | ||
|
||
```{r img-lab, fig.cap='Insert an image.'} | ||
knitr::include_graphics(paste0(getwd(), '/image/rosr_R.png')) | ||
``` | ||
|
||
--- | ||
|
||
## Equations | ||
|
||
Use the `rosr::eq()` function to insert an equation. See Eq. \@ref(eq:sd) | ||
|
||
```{r, results='asis'} | ||
eqs <- 'equation/rosr-eq.Rmd' | ||
rosr::eq(eqs, label = 'sd') | ||
``` |
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,4 @@ | ||
name: Powerpoint Presentation | ||
description: > | ||
Create a powerpoint presentation | ||
create_dir: false |
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,4 @@ | ||
Name: Create a rosr project | ||
Description: Create a interconnected R Markdown project for reproducible research | ||
Binding: create_ui | ||
Interactive: true |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
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
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