|
5 | 5 | ["editing-the-book.html", "Chapter 4 Editing the book 4.1 Creating new chapters 4.2 Linking across chapters 4.3 Advanced editing", " Chapter 4 Editing the book The contents of the book are written in RMarkdown. You can use any formatting code that Pandoc’s Markdown supports, e.g., a math equation \\(a^2 + b^2 = c^2\\). Moreover, you can include chunks of R-code, like this: ```{r} print(\"This is an R-command!\") ``` The results of these chunks can be rendered to the GitBook: ## [1] "This is an R-command!" To edit the book, you can change the text in the .Rmd files. Each Rmd file should contain one and only one chapter. A chapter is defined by the first-level heading #, e.g., # Editing the book. Any sub-headings within the chapter are indicated with several # signs, e.g., ## (level 2) and ### (level 3). 4.1 Creating new chapters To create a new chapter, you must follow two steps: 1) Create the file, and 2) Include it in the list of chapters. First, to create the file for a new chapter in Rstudio, click File > New File > Text file. At the top of the file, write your chapter heading, as explained above. Then, click File > Save. Save the file as .Rmd, without spaces in the file name, e.g.: editing_the_book.Rmd. Second, to include it in the list of chapters, open the file _bookdown.yml (click it in the Files explorer in the bottom right of Rstudio). This file has a list of .Rmd files to be included in the book. In this example, the list looks like this: tmp <- readLines("_bookdown.yml") cat(tmp[grep("^rmd_files", tmp):grep("references\\\\.Rmd", tmp)], sep = "\\n") rmd_files: [“index.Rmd”, “prerequisites.Rmd”, “get_your_gitbook.Rmd”, “editing_the_book.Rmd”, “figures_tables.Rmd”, “examples.Rmd”, “open_educational.Rmd”, “licenses.Rmd”, “references.Rmd”] Insert the file name of your new chapter in the desired position in this list. 4.2 Linking across chapters You can label chapter and section titles using {#label} after them. The labels can be used as cross-references. For example, we can link to Chapter 5. If you do not manually label chapters, there will be automatic labels anyway, e.g., Chapter 6. 4.3 Advanced editing The convenient Rmarkdown Cheat Sheet by Rstudio covers most of the knowledge required for advanced Rmarkdown editing. You can print it out and stick it to your wall! "],
|
6 | 6 | ["figtab.html", "Chapter 5 Figures and tables", " Chapter 5 Figures and tables Figures and tables with captions will be placed in figure and table environments, respectively. par(mar = c(4, 4, .1, .1)) plot(pressure, type = 'b', pch = 19) Figure 5.1: Here is a nice figure! Reference a figure by its code chunk label with the fig: prefix, e.g., see Figure 5.1. Similarly, you can reference tables generated from knitr::kable(), e.g., see Table 5.1. knitr::kable( head(iris, 20), caption = 'Here is a nice table!', booktabs = TRUE ) Table 5.1: Here is a nice table! Sepal.Length Sepal.Width Petal.Length Petal.Width Species 5.1 3.5 1.4 0.2 setosa 4.9 3.0 1.4 0.2 setosa 4.7 3.2 1.3 0.2 setosa 4.6 3.1 1.5 0.2 setosa 5.0 3.6 1.4 0.2 setosa 5.4 3.9 1.7 0.4 setosa 4.6 3.4 1.4 0.3 setosa 5.0 3.4 1.5 0.2 setosa 4.4 2.9 1.4 0.2 setosa 4.9 3.1 1.5 0.1 setosa 5.4 3.7 1.5 0.2 setosa 4.8 3.4 1.6 0.2 setosa 4.8 3.0 1.4 0.1 setosa 4.3 3.0 1.1 0.1 setosa 5.8 4.0 1.2 0.2 setosa 5.7 4.4 1.5 0.4 setosa 5.4 3.9 1.3 0.4 setosa 5.1 3.5 1.4 0.3 setosa 5.7 3.8 1.7 0.3 setosa 5.1 3.8 1.5 0.3 setosa You can write citations, too. For example, we are using the bookdown package (Xie 2020) in this sample book, which was built on top of R Markdown and knitr (Xie 2015). References "],
|
7 | 7 | ["examples.html", "Chapter 6 Examples 6.1 Doing Meta-Analysis in R 6.2 Theory Construction and Statistical Modeling", " Chapter 6 Examples Here are some examples of other GitBooks for courses; if you want to have your GitBook added to the list, please send a Pull Request (here’s how to send a pull request). 6.1 Doing Meta-Analysis in R http://cjvanlissa.github.io/Doing-Meta-Analysis-in-R A GitBook on doing meta-analysis in R, based on the book ‘Doing Meta-Analysis in R’, by Mathias Harrer, Pim Cuijpers, & David Ebert, and adapted to focus on the metafor package, and exploring heterogeneity using metaforest. The original can be found here: https://bookdown.org/MathiasHarrer/Doing_Meta_Analysis_in_R/ 6.2 Theory Construction and Statistical Modeling http://cjvanlissa.github.io/TCSM A GitBook for the course “Theory Construction and Statistical Modeling”, with some interesting code, for example: Blocks of answers to the tutorial questions that can be collapsed and expanded. "],
|
8 |
| -["open-educational-resources.html", "Chapter 7 Open Educational Resources", " Chapter 7 Open Educational Resources UNESCO defines Open Educational Resources as teaching, learning and research materials in any medium – digital or otherwise – that reside in the public domain or have been released under an open license that permits no-cost access, use, adaptation and redistribution by others with no or limited restrictions. Open Educational resources can help lighten the workload on individual teachers, who can collaborate with the development of high-quality open access resources, instead of having to develop their own proprietary materials from scratch. Moreover, Open Educational resources are inclusive, lowering the barrier to knowledge acquisition for learners around the world, and enabling lifelong learning for those outside academia. Many universities support Open Educational Resources. Here are just a few (feel free to send a pull request with other relevant resources). OER Commons: A freely accessible online library of open educational resources. Utrecht University Figshare: Open learning objects from Utrecht University. Johns Hopkins University OCW: Open public health courses and materials. University of Pittsburgh OER: Big List of Open Educational Resources. "], |
9 |
| -["license-your-gitbook.html", "Chapter 8 License your GitBook", " Chapter 8 License your GitBook In the spirit of Open Science, it is good to think about making your course materials Open Source. That means that other people can use them. In principle, if you publish materials online without license information, you hold the copyright to those materials. If you want them to be Open Source, you must include a license. The Creative Commons licenses are typically suitable for course materials. This GitBook, for example, is licensed under CC-BY 4.0. That means you can use and remix it as you like, but you must credit the original source. You can find more information about the Creative Commons Licenses here. Specific licenses that might be useful are: CC0 (“No Rights Reserved”), everybody can do what they want with your work CC-BY 4.0 (“Attribution”), everybody can do what they want with your work, but they must credit you "], |
| 8 | +["open-educational-resources.html", "Chapter 7 Open Educational Resources", " Chapter 7 Open Educational Resources UNESCO defines Open Educational Resources as teaching, learning and research materials in any medium – digital or otherwise – that reside in the public domain or have been released under an open license that permits no-cost access, use, adaptation and redistribution by others with no or limited restrictions. Open Educational resources can help lighten the workload on individual teachers, who can collaborate with the development of high-quality open access resources, instead of having to develop their own proprietary materials from scratch. Moreover, Open Educational resources are inclusive, lowering the barrier to knowledge acquisition for learners around the world, and enabling lifelong learning for those outside academia. Many universities support Open Educational Resources. Here are just a few (feel free to send a pull request with other relevant resources). OER Commons: A freely accessible online library of open educational resources. Utrecht University Figshare: Open learning objects from Utrecht University. Johns Hopkins University OCW: Open public health courses and materials. University of Pittsburgh OER: Big List of Open Educational Resources. MERLOT: Online learning and support materials and content creation tools, led by an international community of educators, learners and researchers. "], |
| 9 | +["license-your-gitbook.html", "Chapter 8 License your GitBook", " Chapter 8 License your GitBook In the spirit of Open Science, it is good to think about making your course materials Open Source. That means that other people can use them. In principle, if you publish materials online without license information, you hold the copyright to those materials. If you want them to be Open Source, you must include a license. It is not always obvious what license to choose. The Creative Commons licenses are typically suitable for course materials. This GitBook, for example, is licensed under CC-BY 4.0. That means you can use and remix it as you like, but you must credit the original source. If your project is more focused on software or source code, consider using the GNU GPL v3 license instead. You can find more information about the Creative Commons Licenses here. Specific licenses that might be useful are: CC0 (“No Rights Reserved”), everybody can do what they want with your work. CC-BY 4.0 (“Attribution”), everybody can do what they want with your work, but they must credit you. Note that this license may not be suitable for software or source code! For compatibility between CC and GNU licenses, see this FAQ. "], |
10 | 10 | ["references.html", "References", " References "]
|
11 | 11 | ]
|
0 commit comments