October 4th, 2016

This week

  • How information is coded in numbers
  • How these numbers are stored and organized
  • How we interact with computers
  • Start using an specific tool: RStudio

How to write a structured document

Markdown

An alternative to ordinary Word Processors is to use text files with a few rules to mark the role of each element.

Text files can be read with any computer, and will be accessible for ever.

Today the Structured Text format most often used is Markdown

Here we show some of the rules

Paragraphs

Consecutive lines of text are one paragraph. They are separated by an empty line

The first paragraph.

Another paragraph

The first paragraph.

Another paragraph

Headers

First level header
==================

Second level header
-------------------

Normal text
First level header
Second level header

Normal text

Headers

alternative format

# Header 1
## Header 2
### Header 3
#### Header 4
Header 1
Header 2
Header 3
Header 4

Unordered List

+ Item 1
+ Item 2
    + Item 2a
    + Item 2b
  • Item 1
  • Item 2
    • Item 2a
    • Item 2b

Sub-lists are indented by 4 spaces

Ordered List:

1. Item 1
1. Item 2
1. Item 3
    1. Item 3a
    1. Item 3b
  1. Item 1
  2. Item 2
  3. Item 3
    1. Item 3a
    2. Item 3b

Images

Images on the web or local files in the same directory:

![optional text](http://example.com/logo.png)

![optional text](images/logo.png)

Tables

|        | sample   | dose | time   | agent            |
|--------|----------|------|--------|------------------|
| 1      | GSM91440 | low  | 5 min  | caffeine         |
| 2      | GSM91893 | low  | 5 min  | caffeine         |
| 3      | GSM91428 | low  | 5 min  | calcofluor white |
| 4      | GSM91881 | low  | 5 min  | calcofluor white |
sample dose time agent
1 GSM91440 low 5 min caffeine
2 GSM91893 low 5 min caffeine
3 GSM91428 low 5 min calcofluor white
4 GSM91881 low 5 min calcofluor white

Computer code

Programs are usually written in a monospaced font

```
this <- is.computer(code)
```

this <- is.computer(code)

Header and metadata

At the beginning of the file

---
title: "Title"
author: "Author's name"
date: "4 October 2016"
output: html_document
---

Notice that the block is wrapped by --- (three hyphens)

Format inside a paragraph

Links

Emphasis

Inside the paragraph we can have *italics* and **bold** text

Inside the paragraph we can have italics and bold text

Inline code

We can speak about `x` and `data`

We can speak about x and data

Write in Markdown

How to solve it

by G. Polya

  • You have to understand the problem.
  • Find the connection between the data and the question. You should obtain a plan of the solution.
  • Carry out your plan.
  • Examine the solution obtained.

More information

read and learn it