Commit e627a103 authored by Arndt Leininger's avatar Arndt Leininger

fixed a couple of things in slides 1

parent 324d549b
......@@ -446,7 +446,7 @@ V1, V2, V3, V4
- Separators between folder names differ between Windows (`\`) and Mac/Linux (`/`).
- However, in R, independent of the OS used, forward slashes (`/`) are used exclusively.
## Absolute file path on Windows
## Absolute and relative file paths on Windows
```
C:
......@@ -459,10 +459,10 @@ C:
+- Melinda
```
- Absolute path to folder Bill: `C:/Users/Bill`
- Absolute path to file `master.csv`: `C:/Users/Bill/project_w_steve_and_linus/data/master.csv`
- Absolute path to project folder: `C:/Users/Bill/project_w_steve_and_linus`
- Relativ path to file `master.csv`: `data/master.csv`
## Absolute file path on Mac OS
## Absolute and relative file paths on Mac OS
```
/
......@@ -476,9 +476,9 @@ C:
```
- Absolute path to folder `project_w_bill_and_linus`: `/Users/Steve/project_w_bill_and_linus`
- Absolute path to file `master.csv`: `/Users/Steve/project_w_bill_and_linus/data/master.csv`
- Relative path to file `master.csv`: `data/master.csv`
## Absolute file path on Linux
## Absolute and relative file paths on Linux
```
/
......@@ -491,8 +491,8 @@ C:
+- tove
```
- Absolute path to folder snippets: `/home/linus/project_w_bill_and_steve`
- Absolute path to file script.R: `/home/linus/project_w_bill_and_steve/data/master.csv`
- Absolute path to project folder: `/home/linus/project_w_bill_and_steve`
- Relative path to file script.R: `data/master.csv`
## Absolute vs. relative paths
......@@ -582,6 +582,20 @@ df <- read.csv('data/BundestagForecastReplicationData.csv',
- The argument `stringsAsFactors = F` will be explained in a bit
## `getwd()`
If you're unsure what your working directory is set to:
```{r}
getwd()
```
```{r, eval=TRUE, echo=FALSE}
setwd('~/Git/r_workshop')
getwd()
```
## Quick hands-on
1. Set the working directory to the r_workshop folder using (`setwd()`).
......@@ -633,7 +647,7 @@ class(df)
## Quick quiz
Which of the code snippets are complete statements that R wil run without error? What's wrong with the others?
Which of the code snippets are complete statements that R will run without error? What's wrong with the others?
1. `print("Hello World!')`
2. `B <- 2/3`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment