September 17, 2019
Many disciplines, including Molecular Biology and Genetics, have become more and more data driven.
Starting now, we will use RStudio, a free software for data analysis
Most users of R are molecular biologists, but it is also used by economists, psychologists and marketing specialists
You have to install R and RStudio in your computer
You have to execute RStudio. Then you will see a screen like this
Click on File → New File → R Markdown
You will get a new window with an example text
It is a text file. One character takes one byte
Colors are only a guide for you. They are not part of the text
Today we will learn how to write text files for our course
This is not Microsoft Word
Today we will focus on a key idea.
To understand the data we need structure
For example, folders in the disk are a hierarchical structure.
Text documents also have a logical structure
Ordinary word processors are based on the WYSIWYG (What You See Is What You Get) philosophy
Users are encouraged to change fonts, sizes, colors and other visual attributes
Writing and formatting at the same time is distracting.
The idea is to write first, and format later, as close as possible to the time of publication.
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
Consecutive lines of text are one paragraph. They are separated by an empty line
The first paragraph. Another paragraph
The first paragraph.
First level header ================== Second level header ------------------- Normal text
First level headerSecond level header
# Header 1 ## Header 2 ### Header 3 #### Header 4
Header 1Header 2Header 3Header 4
+ Item 1 + Item 2 + Item 2a + Item 2b
- Item 1
- Item 2
- Item 2a
- Item 2b
Sub-lists are indented by 4 spaces
1. Item 1 1. Item 2 1. Item 3 1. Item 3a 1. Item 3b
- Item 1
- Item 2
- Item 3
- Item 3a
- Item 3b
To show something remarkable, for example when someone important said something interesting.
> "The limits of my language mean > the limits of my world" > > *Ludwig Wittgenstein*
“The limits of my language mean the limits of my world”
You have to indicate the web address of the image
or the name of a file in the same directory
| | 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 |
|3||GSM91428||low||5 min||calcofluor white|
|4||GSM91881||low||5 min||calcofluor white|
Programs are usually written in a monospaced font.
That is, all letters have the same width.
``` this <- is.computer(code) ```
this <- is.computer(code)
This will be very important in the rest of the course
--- title: "Title" author: "Author's name" date: "4 October 2016" output: html_document ---
Notice that the block is wrapped by
--- (three hyphens)
This is a [clickable text](http://example.com). It can also be written in [a cleaner format]. [a cleaner format]: http://example.com
This is a clickable text. It can also be written in a cleaner format.
We can speak about `x` and `data`
We can speak about