-
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.
Merge pull request #72 from jhudsl/cansavvy/example-fix
Fixing example file copy over function
- Loading branch information
Showing
11 changed files
with
296 additions
and
63 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
title: "Course Title" | ||
--- | ||
|
||
```{r, include = FALSE} | ||
leanbuild::set_knitr_image_path() | ||
``` | ||
|
||
# Introduction | ||
|
||
## Motivation | ||
This course will cover | ||
|
||
**Target Audience:** | ||
The course is intended for | ||
|
||
**Curriculum:** | ||
The curriculum will cover | ||
|
||
This course was funded by |
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,111 @@ | ||
--- | ||
title: "Example Chapter" | ||
--- | ||
|
||
# Example Chapter | ||
|
||
Every chapter needs to start out with this chunk of code: | ||
|
||
```{r, include = FALSE} | ||
leanbuild::set_knitr_image_path() | ||
``` | ||
|
||
### Code examples | ||
|
||
You can demonstrate code like this: | ||
|
||
```{r} | ||
output_dir <- file.path("resources", "code_output") | ||
if (!dir.exists(output_dir)) { | ||
dir.create(output_dir) | ||
} | ||
``` | ||
|
||
And make plots too: | ||
|
||
```{r} | ||
hist_plot <- hist(iris$Sepal.Length) | ||
``` | ||
|
||
You can also save these plots to file: | ||
|
||
```{r} | ||
png(file.path(output_dir, "test_plot.png")) | ||
hist_plot | ||
dev.off() | ||
``` | ||
|
||
### Image example | ||
|
||
|
||
How to include a Google slide. | ||
|
||
```{r, fig.align='center', echo = FALSE, fig.alt= "Major point!! example image"} | ||
leanbuild::include_slide("https://docs.google.com/presentation/d/1YmwKdIy9BeQ3EShgZhvtb3MgR8P6iDX4DfFD65W_gdQ/edit#slide=id.gcc4fbee202_0_141") | ||
``` | ||
|
||
But if you have the slide or some other image locally downloaded you can also use html like this: | ||
|
||
<img src="resources/images/02-example-chapter_files/figure-html//1YmwKdIy9BeQ3EShgZhvtb3MgR8P6iDX4DfFD65W_gdQ_gcc4fbee202_0_141.png" title="Major point!! example image" alt="Major point!! example image" style="display: block; margin: auto;" /> | ||
|
||
|
||
### Video examples | ||
|
||
You can use `knitr::include_url()` like this: | ||
|
||
```{r} | ||
knitr::include_url("https://www.youtube.com/embed/VOCYL-FNbr0") | ||
``` | ||
|
||
OR this works: | ||
|
||
<iframe src="https://www.youtube.com/embed/VOCYL-FNbr0" width="672" height="400px"></iframe> | ||
|
||
### Links to files | ||
|
||
This works: | ||
|
||
```{r, fig.align="center", echo=FALSE} | ||
knitr::include_url("https://www.messiah.edu/download/downloads/id/921/Microaggressions_in_the_Classroom.pdf", height = "800px") | ||
``` | ||
|
||
Or this: | ||
|
||
[This works](https://www.messiah.edu/download/downloads/id/921/Microaggressions_in_the_Classroom.pdf). | ||
|
||
Or this: | ||
|
||
<iframe src="https://www.messiah.edu/download/downloads/id/921/Microaggressions_in_the_Classroom.pdf" width="672" height="800px"></iframe> | ||
|
||
### Links to websites | ||
|
||
Examples of including a website link. | ||
|
||
This works: | ||
|
||
```{r, fig.align="center"} | ||
knitr::include_url("https://yihui.org") | ||
``` | ||
|
||
OR this: | ||
|
||
![Another link](https://yihui.org) | ||
|
||
OR this: | ||
|
||
<iframe src="https://yihui.org" width="672" height="400px"></iframe> | ||
|
||
### Citation examples | ||
|
||
We can put citations at the end of a sentence like this [@R-bookdown]. | ||
Or multiple citations [@R-bookdown, @R-rmarkdown]. | ||
|
||
but they need a ; separator [@R-bookdown, @R-rmarkdown]. | ||
|
||
In text, we can put citations like this @R-rmarkdown. | ||
|
||
## Print out session info | ||
|
||
```{r} | ||
sessionInfo() | ||
``` |
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,13 @@ | ||
book_filename: "Course_Name" | ||
chapter_name: "Chapter " | ||
repo: https://github.com/jhudsl/DaSL_Course_Template_Bookdown/ | ||
rmd_files: ["index.Rmd", | ||
"01-intro.Rmd", | ||
"02-example-chapter.Rmd"] | ||
new_session: yes | ||
bibliography: "references.bib" | ||
delete_merged_file: true | ||
language: | ||
ui: | ||
chapter_name: "Chapter" | ||
output_dir: "docs" |
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,6 @@ | ||
--- | ||
date: "`r format(Sys.time(), '%B, %Y')`" | ||
link-citations: yes | ||
--- | ||
|
||
# About this Course |
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,85 @@ | ||
@Manual{R-base, | ||
title = {R: A Language and Environment for Statistical Computing}, | ||
author = {{R Core Team}}, | ||
organization = {R Foundation for Statistical Computing}, | ||
address = {Vienna, Austria}, | ||
year = {2020}, | ||
url = {https://www.R-project.org/}, | ||
} | ||
|
||
@Manual{R-bookdown, | ||
title = {bookdown: Authoring Books and Technical Documents with R Markdown}, | ||
author = {Yihui Xie}, | ||
year = {2021}, | ||
note = {https://github.com/rstudio/bookdown, | ||
https://pkgs.rstudio.com/bookdown/}, | ||
} | ||
|
||
@Manual{R-knitr, | ||
title = {knitr: A General-Purpose Package for Dynamic Report Generation in R}, | ||
author = {Yihui Xie}, | ||
year = {2021}, | ||
note = {R package version 1.33}, | ||
url = {https://yihui.org/knitr/}, | ||
} | ||
|
||
@Manual{R-rmarkdown, | ||
title = {rmarkdown: Dynamic Documents for R}, | ||
author = {JJ Allaire and Yihui Xie and Jonathan McPherson and Javier Luraschi and Kevin Ushey and Aron Atkins and Hadley Wickham and Joe Cheng and Winston Chang and Richard Iannone}, | ||
year = {2021}, | ||
note = {https://github.com/rstudio/rmarkdown, | ||
https://pkgs.rstudio.com/rmarkdown/}, | ||
} | ||
|
||
@Book{bookdown2016, | ||
title = {bookdown: Authoring Books and Technical Documents with {R} Markdown}, | ||
author = {Yihui Xie}, | ||
publisher = {Chapman and Hall/CRC}, | ||
address = {Boca Raton, Florida}, | ||
year = {2016}, | ||
note = {ISBN 978-1138700109}, | ||
url = {https://bookdown.org/yihui/bookdown}, | ||
} | ||
|
||
@Book{knitr2015, | ||
title = {Dynamic Documents with {R} and knitr}, | ||
author = {Yihui Xie}, | ||
publisher = {Chapman and Hall/CRC}, | ||
address = {Boca Raton, Florida}, | ||
year = {2015}, | ||
edition = {2nd}, | ||
note = {ISBN 978-1498716963}, | ||
url = {https://yihui.org/knitr/}, | ||
} | ||
|
||
@InCollection{knitr2014, | ||
booktitle = {Implementing Reproducible Computational Research}, | ||
editor = {Victoria Stodden and Friedrich Leisch and Roger D. Peng}, | ||
title = {knitr: A Comprehensive Tool for Reproducible Research in {R}}, | ||
author = {Yihui Xie}, | ||
publisher = {Chapman and Hall/CRC}, | ||
year = {2014}, | ||
note = {ISBN 978-1466561595}, | ||
url = {http://www.crcpress.com/product/isbn/9781466561595}, | ||
} | ||
|
||
@Book{rmarkdown2018, | ||
title = {R Markdown: The Definitive Guide}, | ||
author = {Yihui Xie and J.J. Allaire and Garrett Grolemund}, | ||
publisher = {Chapman and Hall/CRC}, | ||
address = {Boca Raton, Florida}, | ||
year = {2018}, | ||
note = {ISBN 9781138359338}, | ||
url = {https://bookdown.org/yihui/rmarkdown}, | ||
} | ||
|
||
@Book{rmarkdown2020, | ||
title = {R Markdown Cookbook}, | ||
author = {Yihui Xie and Christophe Dervieux and Emily Riederer}, | ||
publisher = {Chapman and Hall/CRC}, | ||
address = {Boca Raton, Florida}, | ||
year = {2020}, | ||
note = {ISBN 9780367563837}, | ||
url = {https://bookdown.org/yihui/rmarkdown-cookbook}, | ||
} | ||
|
Oops, something went wrong.