Skip to content

Latest commit

 

History

History
186 lines (111 loc) · 4.19 KB

Contribute.md

File metadata and controls

186 lines (111 loc) · 4.19 KB

Contributing Guide

This is a guide for adding content to this course.

Quick Start

  • Use Pull Requests
  • Use Issues to flag problems or bugs
  • Only edit .Rmd files to change content

Editing Lectures

Lectures are stored within the modules directory. Each module has its own directory. To edit a lecture, locate the appropriate directory within modules and edit the .Rmd file. For example, if you want to edit the Statistics lecture, you'd edit Statistics.Rmd in the modules/Statistics/ directory.

** Do not edit the html or pdf files. These are automatically generated by GitHub Actions. ** However, sometimes workflows don't complete, so it's always good to double check that htmls and pdfs are appearing as expected on the [website]](https://jhudatascience.org/intro_to_r/) once merged to main.

Editing Labs

Within each module directory, there is a subdirectory called lab. Locate the lab subdirectory within the appropriate module directory and edit the _Key.Rmd file. For example, if you want to edit the Statistics lab, you'd edit Statistics_Lab_Key.Rmd in the modules/Statistics/lab/ directory.

** Only edit the _Key.Rmd. Do not edit the html or pdf files, or the _Lab.Rmd file. These are automatically generated by GitHub Actions. ** The _Lab.Rmd file is automatically cleaned up for students to fill in during class.

How does the lab file cleanup work?

When creating the lab key, there will be certain chunks that you'll want to clear out for the students to fill in on their own. For example, question 1 in the key might be:

```{r 1response}
seq(0, 100, 5)
```

but you want students to see:

```{r 1response}
 
```

To make sure this happens correctly, the chunks you want to clean must have a label ending with response or response'. Chunks without a label following this pattern will be ignored and reproduced exactly for the students. For example:

```{r 1response}
seq(0, 100, 5)
```

or

```{r label = '1response'}
seq(0, 100, 5)
```

become, respectively:

```{r 1response}
 
```
```{r label = '1response'}
 
```

Emojis

There are two ways to use emojis.

One way is to copy paste from here.

Or you can use this package.

This is currently installed like:

# install.packages("devtools")
devtools::install_github("hadley/emo")

To use an emoji inline with your text use:

`r emo::ji("smile")`

To use an emoji in a chunk use:

emo::ji("smile")

Smaller text font per slide

If you want to change the style of a slide, modify the style.css file.

For example - this is how you can make slides with smaller font:

In the style .css file is the following- which creates smaller font:

.small {
   font-size: 0.8em;
}

This can be applied to a slide by putting {.small} next to a slide title like so:

## slide name {.small}

Smaller code font per slide

In the style .css file is the following- which creates smaller font:

.codesmall pre {
    font-size: 16px;
}

This can be applied to a slide by putting {.codesmall} next to a slide title like so:

## slide name {.codesmall}

Add color to slide text

:::{style="color: red;""}
RED STUFF!
:::

or like this:

Integer is a special subset of numeric that contains only whole numbers.

Add background color to code chunk describe general syntax for code

In the styles.css file is the following:

.codeexample pre{
  background-color: lightgreen;
}

To add this to a chunk use this in the Rmd file before and after the chunk:

<div class = "codeexample">
```{r}
#some code
```
</div>

Additional help

Create gifs

To create video gifs first record your screen like so (note this is for Mac users):

  1. Command + Shift + 5
  2. Select either entire screen - or more likely a portion of the screen button
  3. Click record

Next convert the video to a gif using https://ezgif.com/video-to-gif.

Be sure that you select gif as the output.