-
Notifications
You must be signed in to change notification settings - Fork 6
/
01-lesson-01-r-for-newbies_slide.Rmd
80 lines (59 loc) · 1.33 KB
/
01-lesson-01-r-for-newbies_slide.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
---
title: "Lesson 1: R for Newbies"
output:
revealjs::revealjs_presentation:
center: true
theme: night
transition: slide
---
# Learning Objectives
##
- Discover what R is
- Understand the advantages of R
- Find your way around RStudio
- Get to know the basic R building blocks of R
# What is R?
##
- R is a *free* software environment for statistical computing and graphics
- It works with a wide variety of platforms
# Why R?
##
1. You can do **anything** in R.
2. R facilitates reproducible science
3. Long term gain from upfront investment
# RStudio - Making R a Breeze
##
- RStudio helps you write in R by:
+ sending your written code to `R`
+ 'syntax-highlighting'
+ keeping a history of your actions
+ giving you tools to fix your code when it doesn't work (debugging)
# RStudio - Live Coding Session
##
![](img/r-studio-windows-vanilla.jpeg)
# R building blocks
##
- The 3 main building block of R are:
+ names
+ data: vectors and data frames
+ functions
# Names
##
- We use the `<- ` assignment operator to assign a name.
```{r names, echo=TRUE}
answer <- 42
msg <- "Hello World!"
answer
msg
```
# Data
##
- Vectors
- Dataframes
# Functions
##
- Functions are litte machines that perform specific tasks.
# Help Files
##
- Help files tell you how functions work.
- Clear, but technical language