Learning Objectives

After this week, students will be able to:

  • Use the main markup format syntax in an rmarkdown document
  • Include images from other URL or saved in a project
  • Render simple rmarkdown documents (pdf, html, word)
  • R Notebooks are not covered yet

Other software for version control (5 min)

Images from medium original article

Cloning repositories (20 min)

Markup languages (5 min)

Heading
=======

Sub-heading
-----------

# Alternative heading #

Paragraphs are separated
by a blank line.

Two spaces at the end of a line
produce a line break.
  1. HyperText Markup Language (HTML): used for websites and the internet in general.
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>My test page</title>
  </head>
  <body>
  <h1>Heading</h1>

  <h2>Sub-heading</h2>

  <h1>Alternative heading</h1>

  <p>Paragraphs are separated
  by a blank line.</p>

  <p>Two spaces at the end of a line<br />
  produce a line break.</p>

    <h1>Mozilla is cool</h1>
    <img src="images/firefox-icon.png" alt="The Firefox logo: a flaming fox surrounding the Earth.">

    <p>At Mozilla, we’re a global community of</p>

    <ul> <!-- changed to list in the tutorial -->
      <li>technologists</li>
      <li>thinkers</li>
      <li>builders</li>
    </ul>

    <p>working together to keep the Internet alive and accessible, so people worldwide can be informed contributors and creators of the Web. We believe this act of human collaboration across an open platform is essential to individual growth and our collective future.</p>

    <p>Read the <a href="https://www.mozilla.org/en-US/about/manifesto/">Mozilla Manifesto</a> to learn even more about the values and principles that guide the pursuit of our mission.</p>
  </body>
</html>
  1. LaTeX: used for writing documents that include complex math expressions or non-Latin scripts, such as Arabic, Devanagari, Greek, Sanskrit, and Chinese.
\documentclass{article} % Starts an article
\usepackage{amsmath} % Imports amsmath
\title{\LaTeX} % Title

\begin{document} % Begins a document
  \maketitle
  \LaTeX{} is a document preparation system for the \TeX{} typesetting program. It offers programmable desktop publishing features and extensive facilities for automating most aspects of typesetting and desktop publishing, including numbering and  cross-referencing, tables and figures, page layout, bibliographies, and much more. \LaTeX{} was originally written in 1984 by Leslie Lamport and has become the  dominant method for using \TeX; few people write in plain \TeX{} anymore. The current version is \LaTeXe.

  % This is a comment, not shown in final output.
  % The following shows typesetting  power of LaTeX:
  \begin{align}
    E_0 &= mc^2 \\
    E &= \frac{mc^2}{\sqrt{1-\frac{v^2}{c^2}}}
  \end{align}
\end{document}

Rmarkdown (15 min)

Resources: Reproducible documents with rmarkdown “Getting Started with rmarkdown by Coding club”

and first steps for project collaboration on GitHub (15 min)

Individual Activity (15 min)

  1. Using the markdown cheatsheet available on the README, use as many format options as you can to make a summary of what you have learned in the course so far.
  2. Create a PDF file from your .Rmd file
  3. Add, commit and push the files that you just created.

Homework Activity

rmarkdown demo R code