class: center, middle, inverse, title-slide # Introduction to programming in R (1) ## R Foundations for Life Scientists ###
Marcin Kierczak
| 06-Nov-2020 ### NBIS, SciLifeLab --- exclude: true count: false <link href="https://fonts.googleapis.com/css?family=Roboto|Source+Sans+Pro:300,400,600|Ubuntu+Mono&subset=latin-ext" rel="stylesheet"> <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous"> <!-- ------------ Only edit title, subtitle & author above this ------------ --> --- 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. .right[.small[source: [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? .end-text[ <p>R version 4.0.3 (2020-10-10)<br><p>Platform: x86_64-pc-linux-gnu (64-bit)</p><p>OS: Ubuntu 18.04.5 LTS</p><br> <hr> <span class="small">Built on : <i class='fa fa-calendar' aria-hidden='true'></i> 06-Nov-2020 at <i class='fa fa-clock-o' aria-hidden='true'></i> 22:20:58</span> <b>2020</b> • [SciLifeLab](https://www.scilifelab.se/) • [NBIS](https://nbis.se/) ]