3/13/2019

The filesystem

We call these directories and subdirectories:

The home direcory on Windows

The home directory on a Mac

Full path on Windows

Full path on Mac

Working directory

getwd()
## [1] "/Users/ririzarr/myDocuments/teaching/data-science/ds4stats/lectures"

Relative path

list.files(".")
## [1] "00-getting-started.Rmd"            
## [2] "01-intro-to-tidyverse.Rmd"         
## [3] "03-dataviz-principles.Rmd"         
## [4] "04-ggplot2.Rmd"                    
## [5] "05-wrangling.Rmd"                  
## [6] "06-intro-to-machine-learning_cache"
## [7] "06-intro-to-machine-learning.Rmd"  
## [8] "img"

Full paths

path <- getwd()
list.files(path)
## [1] "00-getting-started.Rmd"            
## [2] "01-intro-to-tidyverse.Rmd"         
## [3] "03-dataviz-principles.Rmd"         
## [4] "04-ggplot2.Rmd"                    
## [5] "05-wrangling.Rmd"                  
## [6] "06-intro-to-machine-learning_cache"
## [7] "06-intro-to-machine-learning.Rmd"  
## [8] "img"

RStudio

knitr::include_graphics("https://rafalab.github.io/dsbook/R/img/rstudio.png")

R markdown

R chunks in R markdown

Running R chunks

  • To run a command on Mac: command + return
  • To run a command on Windows: control + enter
  • To run an entire chunk on Mac: command + shift + return
  • To run a command on Windows: Control + Shift + Enter

Starting an R chunk

  • Mac: command + option + I
  • Windows: Control + Alt + I

Keyboard Shortcuts