-
Notifications
You must be signed in to change notification settings - Fork 10
/
slide_r_programming_1.Rmd
134 lines (89 loc) · 2.77 KB
/
slide_r_programming_1.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
---
title: "Introduction To Programming in R (1)"
subtitle: "R Foundations for Life Scientists"
author: "Marcin Kierczak"
keywords: bioinformatics, course, scilifelab, nbis, R
output:
xaringan::moon_reader:
encoding: 'UTF-8'
self_contained: false
chakra: 'assets/remark-latest.min.js'
css: 'assets/slide.css'
lib_dir: libs
nature:
ratio: '4:3'
highlightLanguage: r
highlightStyle: github
highlightLines: true
countIncrementalSlides: false
slideNumberFormat: "%current%/%total%"
---
exclude: true
count: false
```{r,echo=FALSE,child="assets/header-slide.Rmd"}
```
<!-- ------------ Only edit title, subtitle & author above this ------------ -->
```{r,echo=FALSE,message=FALSE,warning=FALSE}
# load the packages you need
#library(dplyr)
#library(tidyr)
#library(stringr)
#library(ggplot2)
```
---
name: programming_language
# Computer program
--
* flow of data
--
* from one function to another
--
* each function does something to the data
--
# How?
--
> A **programming language** is a formal computer language or constructed language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs to control the behavior of a machine or to express algorithms.
.small[[Wikipedia](https://en.wikipedia.org/wiki/Programming_language)]
--
# Three things to think about
* what *types* of data can I process?
--
* how do I *write* what I want?
--
* when does it *mean* anything?
---
# Three components of a language
--
* what *types* of data can I process — *type system*
--
* int — 1 2 5 9
* double — 1.23 -5.74
* char — a b test 7 9
--
* how do I *write* what I want — *syntax* defined by a language *grammar*
`2 * 1 + 1` vs. `(+ (* 2 1) 1)`
--
* when does it *mean* anything — *semantics*
--
* *Colorful yellow train sleeps on a crazy wave.* — has no generally accepted meaning
* *There is $500 on his empty bank acount.* — internal contradiction
---
name: topic2
# Where to start?
*Divide et impera* — divide and rule.
**Top-down approach:** define the big problem and split it into smaller ones. Assume you have solution to the small problems and continue — push the responsibility down.
Wishful thinking!
<!-- --------------------- Do not edit this and below --------------------- -->
---
name: end_slide
class: end-slide, middle
count: false
# Thank you. Questions?
```{r,echo=FALSE,child="assets/footer-slide.Rmd"}
```
```{r,include=FALSE,eval=FALSE}
# manually run this to render this document to HTML
rmarkdown::render("presentation_demo.Rmd")
# manually run this to convert HTML to PDF
#pagedown::chrome_print("presentation_demo.html",output="presentation_demo.pdf")
```