knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.align = 'center', fig.width = 6, fig.height = 4 )
pkgs <- c("iheiddown", "magrittr", "ggplot2") lapply(pkgs, library, character.only = TRUE)
While {iheiddown}
's main aim is to assist students in writing their thesis, it
can also be used for shorter projects such as problem sets. This short article
will walk you through the process of using the problem set template.
The installation process is the same than for the thesis template. You'll need the following software:
{iheiddown}
by typing the following command
install.packages("iheiddown")
in the R-Studio console. Note: typing remotes::install_github("jhollway/iheiddown")
will provide you
with the latest version from GitHub.
Creating your first problem set is easy! Before we begin, we have to create a new R project by clicking on the file tab in the top of the RStudio window and following the instructions of the prompt that appears. Now that we have created an R project for our presentation, we can open a new R-Markdown file. To do this click on the "plus file" logo in the top left corner and then on "R-Markdown".
knitr::include_graphics("images/problemset/0-Open_Project.png", dpi = 144)
After you have done this, a little pop-up helper will appear. The first thing we
will do is to select the {iheiddown}
template for our presentation. To do so,
click on the "From Template" option on the left and select the
"Problem Set {iheiddown}" template. Now give your file a name and click
on "OK".
knitr::include_graphics("images/problemset/1-Create_PS.png", dpi = 144)
Congrats! You just created your first problem set! We can actually already
render our problem set. This is done by simply clicking the "knit button"
while viewing the MyProblemSet.Rmd
pane. Et voilĂ ! You have now successfully
generated your first problem set with R.
Take a moment to read through the generated problem set to get acquainted
with the {R-markdown}
syntax and to get a feel of the possibilities of the
{iheiddown}
theme.
This section will focus on giving you an overview of the workflow of writing
your problem sets in R with{iheiddown}
.
The general options are set in the YAML header. You can define the metadata such as the name of the authors, the course code (required for the file name), and the course name.
You can also set bibliographic options such as the .bib
file you want to draw
your references from (references.bib
by default) and the style of the
bibliographic entries by altering the .csl
file. Note that packages that were
used in the code chunks of your problem set have their citation information
automatically written to a second .bib
file called packages.bib
. That way
you easily give appropriate credit to the work of the creators of the packages
you use.
That's it! You're now all set to focus on the content of your problem sets. Again, please take a moment to read through the problem set template once it is generated as it serves as much as a tutorial than this vignette.
You might have spotted a somewhat unusual code chunk at the end of the file in the appendix section.
`r ''````r
This special code chunk displays all the code you ran neatly at the end of your analysis. This will help you keep your problem sets clean while still providing your reader with a high level of transparency on how you manipulated your data and created your output.
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.