diff --git a/01_DataScientistToolbox/01_01_seriesMotivation/gettingdata_motivation.Rmd b/01_DataScientistToolbox/01_01_seriesMotivation/gettingdata_motivation.Rmd new file mode 100644 index 000000000..3c473b4a5 --- /dev/null +++ b/01_DataScientistToolbox/01_01_seriesMotivation/gettingdata_motivation.Rmd @@ -0,0 +1,32 @@ +--- +title: "Getting and Cleaning Data +Motivation" +author: "Jeff Leek" +date: "October 3, 2014" +output: ioslides_presentation +--- + +## R Markdown + +This is an R Markdown presentation. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see . + +When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. + +## Slide with Bullets + +- Bullet 1 +- Bullet 2 +- Bullet 3 + +## Slide with R Code and Output + +```{r} +summary(cars) +``` + +## Slide with Plot + +```{r, echo=FALSE} +plot(cars) +``` + diff --git a/01_DataScientistToolbox/01_01_seriesMotivation/gettingdata_motivation.html b/01_DataScientistToolbox/01_01_seriesMotivation/gettingdata_motivation.html new file mode 100644 index 000000000..5a19f70b6 --- /dev/null +++ b/01_DataScientistToolbox/01_01_seriesMotivation/gettingdata_motivation.html @@ -0,0 +1,159 @@ + + + + Getting and Cleaning Data Motivation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+

+

+

October 3, 2014

+
+
+ +

R Markdown

+ +

This is an R Markdown presentation. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

+ +

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document.

+ +

Slide with Bullets

+ +
    +
  • Bullet 1
  • +
  • Bullet 2
  • +
  • Bullet 3
  • +
+ +

Slide with R Code and Output

+ +
summary(cars)
+ +
##      speed           dist    
+##  Min.   : 4.0   Min.   :  2  
+##  1st Qu.:12.0   1st Qu.: 26  
+##  Median :15.0   Median : 36  
+##  Mean   :15.4   Mean   : 43  
+##  3rd Qu.:19.0   3rd Qu.: 56  
+##  Max.   :25.0   Max.   :120
+ +

Slide with Plot

+ +

plot of chunk unnamed-chunk-2

+ + + + +
+ + + + + + + + + + + + + + + + + diff --git a/01_DataScientistToolbox/01_01_seriesMotivation/gettingdata_motivation.pdf b/01_DataScientistToolbox/01_01_seriesMotivation/gettingdata_motivation.pdf new file mode 100644 index 000000000..e270aa3a4 Binary files /dev/null and b/01_DataScientistToolbox/01_01_seriesMotivation/gettingdata_motivation.pdf differ diff --git a/03_GettingData/01_01_obtainingDataMotivation/.Rhistory b/03_GettingData/01_01_obtainingDataMotivation/.Rhistory index 40984eaf2..04bb8490b 100644 --- a/03_GettingData/01_01_obtainingDataMotivation/.Rhistory +++ b/03_GettingData/01_01_obtainingDataMotivation/.Rhistory @@ -1,13 +1,512 @@ -setwd("~/Dropbox/Jeff/teaching/2013/modules/08_PredictionAndMachineLearning/") -ls() -list.files() -setwd("001predictionStudyDesign/") -slidify("index.Rmd") +plotRegionCoverage(regions$chr21$regions, regionCoverage = regionCov, groupInfo = groupInfo, nearestAnnotation = annoNear, annotatedRegions = annoGenome, whichRegions = 1,scalefac=5) +library(derfinderPlot) +plotRegionCoverage(regions$chr21$regions, regionCoverage = regionCov, groupInfo = groupInfo, nearestAnnotation = annoNear, annotatedRegions = annoGenome, whichRegions = 1,scalefac=5) +plotRegionCoverage(regions$chr21$regions, regionCoverage = regionCov, groupInfo = groupInfo, nearestAnnotation = annoNear, annotatedRegions = annoGenome, whichRegions = 1:100,scalefac=5) +regions$coverageMatrix[1:10,] +regions$coverageMatrix +names(regions) +regionCov +regionCov[1,] +regions$chr21$coverageMatrix[1,] +plot(regions$chr21$coverageMatrix[1,]) +dim(regionCov[[1]]_ +dim(regionCov[[1]]) +dim(regionCov[[1]]) +plot(regionCov[[1]][,1]) +par(mfrow=c(1,2)) +plot(regionCov[[1]][,1]) +plot(regionCov[[1]][,2]) +plot(regionCov[[1]][,3]) +regionCov[[1]] +biocLite("epivzr") +mgr <- startEpiviz() +library(epivzr) +biocLite("epivizr") +library(epivizr) +mgr <- startEpiviz() +regs_dev <- mgr$addDevice(regionMat$chr21$regions, "Region Matrix") +regs_dev <- mgr$addDevice(readcov$chr21$regions, "Region Matrix") +names(readcov) +regs_dev <- mgr$addDevice(regions$chr21$regions, "Region Matrix") +mgr <- startEpiviz() +mgr <- startEpiviz(tryPorts=TRUE) +regs_dev <- mgr$addDevice(regions$chr21$regions, "Region Matrix") +mgr$navigate("chr21", 1, 10000) +mgr <- startEpiviz(tryPorts=TRUE) +regs_dev <- mgr$addDevice(regions$chr21$regions, "Region Matrix") +mgr$navigate("chr21", 1, 10000) +regs_dev <- mgr$addDevice(regions$chr21$regions, "Region Matrix") +regs_dev +mgr$navigate("chr21", 1, 10000) +dim(regions) +names(regions) +names(regions$chr21) +plot(regions$chr21$coverageMatrix[1,]) +plot(regions$chr21$coverageMatrix[2,]) +par(mfrow=c(1,2),ask=F) +plot(regions$chr21$coverageMatrix[2,]) +par(mfrow=c(1,1),ask=F) +plot(regions$chr21$coverageMatrix[2,]) +plot(regions$chr21$coverageMatrix[3,]) +plot(regions$chr21$coverageMatrix[4,]) +data(hg19Ideogram, package = 'biovizBase', envir = environment()) +library('GenomicRanges') +seqlengths(regions$chr21$regions) <- seqlengths(hg19Ideogram)[names(seqlengths(regions$chr21$regions))] +regions = regionMatrix(list(chr21=readcov),cutoff=10,L=75) +regionCov <- getRegionCoverage(fullCov, regions$chr21$regions) +annoGenome <- annotateRegions(regions$chr21$regions, genomicState$fullGenome) +library('bumphunter') +annoNear <- annotateNearest(regions$chr21$regions, subject = 'hg19') +install.package("pwr") +install.packages("owr") +install.packages("pwr") +library(pwr) +citation(pwr) +citation("pwr") +16.9e6/55.5e6 + 0 +1.1e3/17.6e3 +1.1e3/17.6e3 + 38194/(185740) +4.5e3/17.6e3 + 4011/(185740) +2.6e3/17.6e3 + 2348/(185740) +library(sva) +library(sva) +library(bladderbatch) +data(bladderdata) +library(pamr) +library(limma) +heno = pData(bladderEset) +################################################### +### code chunk number 4: input +################################################### +edata = exprs(bladderEset) +mod = model.matrix(~1, data=pheno) +pheno = pData(bladderEset) +edata = exprs(bladderEset) +batch = pheno$batch +mod = model.matrix(~1, data=pheno) +combat_edata = ComBat(dat=edata, batch=batch, mod=mod, numCovs=NULL, par.prior=TRUE, prior.plots=FALSE) +dim(exprs(edata)) +dim(edata) +edata2 = rnorm(22283*57,nrow=22283) +edata2 = matrix(rnorm(22283*57),nrow=22283) +combat_edata = ComBat(dat=edata, batch=batch, mod=mod, numCovs=NULL, par.prior=TRUE, prior.plots=FALSE) +combat_edata = ComBat(dat=edata2, batch=batch, mod=mod, numCovs=NULL, par.prior=TRUE, prior.plots=FALSE) +pValuesComBat = f.pvalue(combat_edata,mod,mod0) +mod1 = model.matrix(~as.factor(cancer), data=pheno) +pValuesComBat = f.pvalue(combat_edata,mod1,mod) +hist(pValuesComBat) +combat_edata = ComBat(dat=edata2, batch=batch, mod=mod1, numCovs=NULL, par.prior=TRUE, prior.plots=FALSE) +pValuesComBat = f.pvalue(combat_edata,mod1,mod) +hist(pValuesComBat) +mod = model.matrix(~1, data=pheno) +combat_edata = ComBat(dat=edata, batch=batch, mod=mod, numCovs=NULL, par.prior=TRUE, prior.plots=FALSE) +mod1 = model.matrix(~as.factor(cancer), data=pheno) +mod0 = model.matrix(~1, data=pheno) +pValuesComBat = f.pvalue(combat_edata,mod,mod0) +qValuesComBat = p.adjust(pValuesComBat,method="BH") +hist(pValuesComBat) +hist(pValuesComBat$p.values) +pValuesComBat = f.pvalue(combat_edata,mod1,mod0) +hist(pValuesComBat) +mod = model.matrix(~1, data=pheno) +combat_edata = ComBat(dat=edata, batch=batch, mod=mod, numCovs=NULL, par.prior=TRUE, prior.plots=FALSE) +mod1 = model.matrix(~as.factor(cancer), data=pheno) +mod0 = model.matrix(~1, data=pheno) +pValuesComBat = f.pvalue(combat_edata,mod1,mod0) +hist(pValuesComBat) +hist(edata) +qqnorm(edata) +edata = edata2 +mod = model.matrix(~1, data=pheno) +combat_edata = ComBat(dat=edata, batch=batch, mod=mod, numCovs=NULL, par.prior=TRUE, prior.plots=FALSE) +mod1 = model.matrix(~as.factor(cancer), data=pheno) +mod0 = model.matrix(~1, data=pheno) +pValuesComBat = f.pvalue(combat_edata,mod1,mod0) +qValuesComBat = p.adjust(pValuesComBat,method="BH") +hist(pValuesComBat) +install.packages("dplyr") +?arrange +library(dplyr) +?arrange +df = tbl_df(data.frame(owner=c(0,0,1,1), obs1=c("quiet", "loud", "quiet", "loud"), obs2=c("loud", "loud", "quiet", "quiet"))) +df +gather(observation, Val, obs1:obs2) +library(tidyr) +install.packages("tidyr") +library(tidyr) +gather(observation, Val, obs1:obs2) +df %>% +gather(observation, Val, obs1:obs2) +df +df %>% +gather(observation, Val, obs1:obs2) %>% +group_by(owner,observation, Val) +?group_by +df %>% +gather(observation, Val, obs1:obs2) %>% +group_by(owner,observation, Val) %>% +summarise(n= n()) +df %>% +gather(observation, Val, obs1:obs2) %>% +group_by(owner,observation, Val) %>% +summarise(n= n()) %>% +spread(Val, n, fill=0) +tmp = fromJSON("https://api.github.com/users/jtleek/repos") +library(jsonlite) +tmp = fromJSON("https://api.github.com/users/jtleek/repos") +tmp +class(tmp) +tmp[1,] +tmp = fromJSON("https://api.github.com/users/jtleek/repos") +names(tmp) +sapply(tmp,data) +sapply(tmp,class) +table(sapply(tmp,class)) +which(sapply(tmp,class)==data.frame) +which(sapply(tmp,class)=="data.frame") +tmp$owner +dim(tmp$owner) +sapply(tmp,dim) +tmp +library(dplyr) +leekdata = fromJSON("https://api.github.com/users/jtleek/repos") +pengdata = fromJSON("https://api.github.com/users/rdpeng/repos") +gitdata = rbind(leekdata,pengdata) +leekdata[1,] +rownames(leekdata) +library(dplyr) +leekdata = fromJSON("https://api.github.com/users/jtleek/repos") +pengdata = fromJSON("https://api.github.com/users/rdpeng/repos") +rownames(leekdata) = rownames(pengdata)=NULL +gitdata = rbind(leekdata,pengdata) +row +library(dplyr) +leekdata = fromJSON("https://api.github.com/users/jtleek/repos") +pengdata = fromJSON("https://api.github.com/users/rdpeng/repos") +row.names(leekdata) = row.names(pengdata)=NULL +rownames(leekdata) +row.names(leekdata) +row.names(leekdata) = NULL +rownames(leekdata) +rownames(leekdata) = NULL +rownames(leekdata) +rownames(leekdata) == NULL +rownames(leekdata) = NULL +rownames(leekdata) +library(quantmod) +install.packages("quantmod") +library(quantmod) +?getSymobl +?getSymbol +?quantmod +getSymbols("MSFT +") +ls( +) +getSymbols("MSFT") +MSFT +names(MSFT) +rownames(msft) +msft = MSFT +?mutat +?mutate +class(msft) +msft = as.data.frame(msft) +class(msft) +msft +names(msft) +?mutate +mutate(msft,date=rownames(msft)) +tmp = mutate(msft,date=rownames(msft)) +tmp[1,] +class(tmp$date) +library(lubridate) +month(tmp$date) +library(dplyr) +library(quantmod) +library(lubridate) +getSymbols(MSFT) +msft = MSFT +msft = as.data.frame(msft) +mutate(msft,date=month(rownames(msft))) +msft = tbl_df(msft) +msft +## Load libraries +library(dplyr) +library(quantmod) +library(lubridate) +## Get the data and make it a data frame +getSymbols(MSFT) +msft = MSFT +msft = as.data.frame(msft) +msft +msft +msft = tbl_df(msft) +msft +## Get the data and make it a data frame +getSymbols(MSFT) +msft = MSFT +msft = as.data.frame(msft) +msft +msft = tbl_df(msft) +msft +### Make the rownames a column of the data set +msft = mutate(msft,date=rownames(msft),month=month(date)) +msft[1,] +## Get the data and make it a data frame +getSymbols(MSFT) +MSFT = as.data.frame(MSFT) +msft +msft = tbl_df(MSFT) +msft +### Make the rownames a column of the data set +msft1 = mutate(msft,date=rownames(msft)) +### Add the month to the data set +msft2 = mutate(msft1,month=month(date)) +### Do both steps at once +msft3 = mutate(msft,date=rownames(msft),month=month(date)) +## Load libraries +library(dplyr) +library(quantmod) +library(lubridate) +## Get the data and make it a data frame +getSymbols("MSFT") +MSFT = as.data.frame(MSFT) +msft +msft = tbl_df(MSFT) +msft +### Make the rownames a column of the data set +msft1 = mutate(msft,date=rownames(msft)) +### Add the month to the data set +msft2 = mutate(msft1,month=month(date)) +### Do both steps at once +msft3 = mutate(msft,date=rownames(msft),month=month(date)) +msft3 +msft4 = arrange(msft3,desc(month)) +msft4 +msft5 = arrange(msft3,desc(month),MSFT.Open) +msft5 +msf6 = select(msft5, MSFT.Open,month) +msft6 +msft6 = select(msft5, MSFT.Open,month) +msft6 +msft6 = select(msft5, MSFT.Open:MSFT.Close) +msft6 library(slidify) -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") +library(makeslides) +library(help="makeslides") +setwd("~/Dropbox/Jeff/teaching/coursera/courses/03_GettingData/01_01_obtainingDataMotivation/") +sf() +sf() +library(sva) +library(ffpe) +library(RColorBrewer) +library(corrplot) +library(limma) +trop = RSkittleBrewer('tropical') +load("fpkm.rda") +pd = ballgown::pData(fpkm) +plot(1:10) +x = 1:10 +plot(1:10) +plot(1:10) +ploauspjasd;lj +## Load libraries +library(dplyr) +library(quantmod) +library(lubridate) +## Get the data and make it a data frame +getSymbols("MSFT") +MSFT = as.data.frame(MSFT) +msft +msft = tbl_df(MSFT) +msft +msft8 = select(msft5,month < 3, MSFT.Open > 30) +### +### Introduction to dplyr +### +## Load libraries +library(dplyr) +library(quantmod) +library(lubridate) +## Get the data and make it a data frame +getSymbols("MSFT") +MSFT = as.data.frame(MSFT) +msft +msft = tbl_df(MSFT) +msft +### Make the rownames a column of the data set +msft1 = mutate(msft,date=rownames(msft)) +### Add the month to the data set +msft2 = mutate(msft1,month=month(date)) +### Do both steps at once +msft3 = mutate(msft,date=rownames(msft),month=month(date)) +### Sort in descending order of month +msft4 = arrange(msft3,desc(month)) +### Sort in descending order of month and ascending open within month +msft5 = arrange(msft3,desc(month),MSFT.Open) +### Select only the open and the month variables (columns) +msft6 = select(msft5, MSFT.Open,month) +### Select all the variables (columns) from open to close +msft7 = select(msft5, MSFT.Open:MSFT.Close) +### Select all the observations where month < 3 and the open price > 30 +msft8 = select(msft5,month < 3, MSFT.Open > 30) +msft8 +msft8 = filter(msft5,month < 3, MSFT.Open > 30) +msft8 +summarise(msft5, +delay = mean(DepDelay, na.rm = TRUE)) +summarise(msft5, +delay = mean(DepDelay, na.rm = TRUE)) +summarise(msft3, +meanOpen = mean(msft3, na.rm = TRUE)) +summarise(msft3, +meanOpen = mean(MSFT.Open, na.rm = TRUE)) +?summarize +library(dplyr) +library(quantmod) +library(lubridate) +library(dplyr) +library(quantmod) +library(lubridate) +clear() +plot(1:10) +plot(1:10) +library(quantmod) +library(lubridate) +library(dplyr) +getSymbols("MSFT") +ls() +rm(list=ls()) +library(quantmod) +library(lubridate) +library(dplyr) +getSymbols("MSFT") +ls() +class(MSFT) +MSFT = as.data.frame(MSFT) +MSFT +mstf = tbl_df(MSFT) +mstf +msft1 = mutate(msft,date=rownames(msft)) +## Load libraries +library(dplyr) +library(quantmod) +library(lubridate) +## Get the data and make it a data frame +getSymbols("MSFT") +m_dat = as.data.frame(m_dat) +m_dat +m_dat = tbl_df(m_dat) +m_dat +## Load libraries +library(dplyr) +library(quantmod) +library(lubridate) +## Get the data and make it a data frame +getSymbols("MSFT") +m_dat = as.data.frame(MSFT) +m_dat +m_dat = tbl_df(m_dat) +m_dat +### +### Introduction to dplyr +### +## Load libraries +library(dplyr) +library(quantmod) +library(lubridate) +## Get the data and make it a data frame +getSymbols("MSFT") +m_dat = as.data.frame(MSFT) +m_dat +m_dat = tbl_df(m_dat) +m_dat +### +### Introduction to dplyr +### +## Load libraries +library(dplyr) +library(quantmod) +library(lubridate) +## Get the data and make it a data frame +getSymbols("MSFT") +m_dat = as.data.frame(MSFT) +m_dat +m_dat = tbl_df(m_dat) +m_dat +m_dat +m_dat1 = mutate(m_dat,date=rownames(m_dat)) +m_dat1 +## Load libraries +library(dplyr) +library(quantmod) +library(lubridate) +## Get the data and make it a data frame +getSymbols("MSFT") +m_dat = as.data.frame(MSFT) +m_dat +m_dat = tbl_df(m_dat) +m_dat +### Make the rownames a column of the data set +m_dat1 = mutate(m_dat,date=rownames(m_dat)) +m_dat1 +m_dat1 = mutate(m_dat1,month=month(date)) +m_dat1 +m_dat +m_dat = mutate(msft,date=rownames(msft),month=month(date)) +m_dat +m_dat = mutate(m_dat,date=rownames(msft),month=month(date)) +m_dat +m_dat = mutate(m_dat,date=rownames(m_dat),month=month(date)) +m_dat +m_dat = arrange(m_dat,desc(month)) +m_dat +m_dat = arrange(m_dat,desc(month),MSFT.Open) +m_dat +m_dat1 = select(m_dat, MSFT.Open,month) +m_dat1 +m_dat1 = select(m_dat, MSFT.Open:MSFT.Close) +m_dat1 +m_dat1 = filter(m_dat,month < 3, MSFT.Open > 30) +m_dat1 +m_dat1 = filter(m_dat,month < 3, MSFT.Open > 30) +m_dat1 +summarise(m_dat,meanOpen = mean(MSFT.Open, na.rm = TRUE)) +summarise(m_dat,meanOpen = min(MSFT.Open)) +summarise(m_dat,nOpen = n(MSFT.Open)) +summarise(m_dat,nOpen = n()) +summarise(m_dat, n()) +summarise(m_dat,nOpen = n_distinct(MSFT.Open)) +dim(m_dat) +length(unique(m_dat)) +library(quantmod) +library(lubridate) +library(dplyr) +getSymbols("MSFT") +ls() +rm(list=ls()) +library(quantmod) +library(lubridate) +library(dplyr) +getSymbols("MSFT") +ls() +class(MSFT) +m_dat = as.data.frame(MSFT) +m_dat +m_dat = tbl_df(m_dat) +m_dat +m_dat1 = mutate(m_dat,date=rownames(m_dat)) +m_dat1 +m_dat1 = mutate(m_dat1,month=month(date)) +m_dat1 +m_dat = mutate(m_dat,date=rownames(m_dat), month = month(date)) +m_dat +m_dat1 = arrange(m_dat,MSFT.Open) +m_dat1 +m_dat1 = arrange(m_dat,desc(month)) +m_dat1 +rm(list=ls()) +library(quantmod) +library(lubridate) +library(dplyr) diff --git a/03_GettingData/01_01_obtainingDataMotivation/index.html b/03_GettingData/01_01_obtainingDataMotivation/index.html index 2fcb315eb..e69de29bb 100644 --- a/03_GettingData/01_01_obtainingDataMotivation/index.html +++ b/03_GettingData/01_01_obtainingDataMotivation/index.html @@ -1,216 +0,0 @@ - - - - Motivation and pre-requisites - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

Motivation and pre-requisites

-

-

Jeffrey Leek
Johns Hopkins Bloomberg School of Public Health

-
-
- - - -
-

About this course

-
-
-
    -
  • This course covers the basic ideas behind getting data ready for analysis - -
      -
    • Finding and extracting raw data
    • -
    • Tidy data principles and how to make data tidy
    • -
    • Practical implementation through a range of R packages
    • -
  • -
  • What this course depends on - -
      -
    • The Data Scientist's Toolbox
    • -
    • R Programming
    • -
  • -
  • What would be useful - -
      -
    • Exploratory analysis
    • -
    • Reporting Data and Reproducible Research
    • -
  • -
- -
- -
- - -
-

What you wish data looked like

-
-
-

- -
- -
- - -
-

What does data really look like?

-
- - -
- - -
-

What does data really look like?

-
- - -
- - -
-

What does data really look like?

-
- - -
- - -
-

Where is data?

-
- - -
- - -
-

Where is data?

-
- - -
- - -
-

Where is data?

-
- - -
- - -
-

The goal of this course

-
-
-



- -

Raw data -> Processing script -> tidy data -> data analysis -> data communication

- -
- -
- - -
- - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/03_GettingData/01_01_obtainingDataMotivation/index.md b/03_GettingData/01_01_obtainingDataMotivation/index.md index 11941f95d..8c53adb32 100644 --- a/03_GettingData/01_01_obtainingDataMotivation/index.md +++ b/03_GettingData/01_01_obtainingDataMotivation/index.md @@ -18,7 +18,6 @@ mode : selfcontained # {standalone, draft} - ## About this course * This course covers the basic ideas behind getting data ready for analysis diff --git a/03_GettingData/01_04_downLoadingFiles/downloadingFiles.R b/03_GettingData/01_04_downLoadingFiles/downloadingFiles.R new file mode 100644 index 000000000..f108be5de --- /dev/null +++ b/03_GettingData/01_04_downLoadingFiles/downloadingFiles.R @@ -0,0 +1,32 @@ +### +### Title: Downloading files +### Author: Jeff Leek +### Date: October 3, 2014 +### + +## Get working directory +getwd() + +## Set working directory (relative) +setwd("../") +getwd() + +## Set working directory (absolute) + +setwd("~/Desktop") + +## Show the files in a directory + +list.files("./") + +## Check to see if a file/directory exists + +file.exists("test") + +## Make a directory + +dir.create("test") + +## Same thing but checking if it exists first + +if(!file.exists("data")){dir.create("data")} \ No newline at end of file diff --git a/assets/img/03_ObtainingData/asdfree.png b/assets/img/03_ObtainingData/asdfree.png index 2a0f95bb5..14c83166d 100644 Binary files a/assets/img/03_ObtainingData/asdfree.png and b/assets/img/03_ObtainingData/asdfree.png differ diff --git a/assets/img/03_ObtainingData/austerity.jpg b/assets/img/03_ObtainingData/austerity.jpg new file mode 100644 index 000000000..55639f1fd Binary files /dev/null and b/assets/img/03_ObtainingData/austerity.jpg differ diff --git a/assets/img/03_ObtainingData/codebook.png b/assets/img/03_ObtainingData/codebook.png new file mode 100644 index 000000000..f68ca487d Binary files /dev/null and b/assets/img/03_ObtainingData/codebook.png differ diff --git a/assets/img/03_ObtainingData/datagov.png b/assets/img/03_ObtainingData/datagov.png new file mode 100644 index 000000000..89a909f31 Binary files /dev/null and b/assets/img/03_ObtainingData/datagov.png differ diff --git a/assets/img/03_ObtainingData/gapminder.png b/assets/img/03_ObtainingData/gapminder.png index acd99a1bd..12c699811 100644 Binary files a/assets/img/03_ObtainingData/gapminder.png and b/assets/img/03_ObtainingData/gapminder.png differ diff --git a/assets/img/03_ObtainingData/growthdebt.png b/assets/img/03_ObtainingData/growthdebt.png new file mode 100644 index 000000000..d9950102a Binary files /dev/null and b/assets/img/03_ObtainingData/growthdebt.png differ diff --git a/assets/img/03_ObtainingData/recipe.png b/assets/img/03_ObtainingData/recipe.png new file mode 100644 index 000000000..b1e724da5 Binary files /dev/null and b/assets/img/03_ObtainingData/recipe.png differ diff --git a/assets/img/03_ObtainingData/recipeok.png b/assets/img/03_ObtainingData/recipeok.png new file mode 100644 index 000000000..e73d6e5cd Binary files /dev/null and b/assets/img/03_ObtainingData/recipeok.png differ