Skip to content

Commit

Permalink
Use library() with all packages since not using Depends anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
Chester Ismay committed May 29, 2020
1 parent 1782d9c commit b5dd154
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 5 additions & 2 deletions inst/rmarkdown/templates/thesis/skeleton/01-chap1.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ We begin by checking to ensure that needed packages are installed and then we lo

```{r load_pkgs, message=FALSE}
# List of packages required for this analysis
pkg <- c("dplyr", "ggplot2", "knitr", "bookdown", "devtools")
pkg <- c("dplyr", "ggplot2", "knitr", "bookdown")
# Check if packages are not installed and assign the
# names of the packages not installed to the variable new.pkg
new.pkg <- pkg[!(pkg %in% installed.packages())]
Expand All @@ -126,8 +126,11 @@ new.pkg <- pkg[!(pkg %in% installed.packages())]
if (length(new.pkg)) {
install.packages(new.pkg, repos = "https://cran.rstudio.com")
}
# Load packages (thesisdown will load all of the packages as well)
# Load packages
library(thesisdown)
library(dplyr)
library(ggplot2)
library(knitr)
```

\clearpage
Expand Down
5 changes: 4 additions & 1 deletion inst/rmarkdown/templates/thesis/skeleton/03-chap3.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ if (!require(thesisdown)) {
}
}
library(thesisdown)
library(dplyr)
library(ggplot2)
library(knitr)
flights <- read.csv("data/flights.csv", stringsAsFactors = FALSE)
```

Expand All @@ -73,7 +76,7 @@ flights <- read.csv("data/flights.csv", stringsAsFactors = FALSE)

## Tables

In addition to the tables that can be automatically generated from a data frame in **R** that you saw in [R Markdown Basics] using the `kable` function, you can also create tables using _pandoc_. (More information is available at <https://pandoc.org/README.html#tables>.) This might be useful if you don't have values specifically stored in **R**, but you'd like to display them in table form. Below is an example. Pay careful attention to the alignment in the table and hyphens to create the rows and columns.
In addition to the tables that can be automatically generated from a data frame in **R** that you saw in [R Markdown Basics] using the `kable()` function, you can also create tables using _pandoc_. (More information is available at <https://pandoc.org/README.html#tables>.) This might be useful if you don't have values specifically stored in **R**, but you'd like to display them in table form. Below is an example. Pay careful attention to the alignment in the table and hyphens to create the rows and columns.

----------------------------------------------------------------------------------
Factors Correlation between Parents & Child Inherited
Expand Down

0 comments on commit b5dd154

Please sign in to comment.