From 63b3a9f25d662a7341273da7d033078a41ed2e9e Mon Sep 17 00:00:00 2001 From: Ramnath Vaidyanathan Date: Tue, 22 Jan 2013 11:45:18 -0500 Subject: [PATCH 1/3] update .gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 9b00344..5f3d36a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ .DS_Store .Rhistory .cache/ +.Rproj.user +*.Rproj \ No newline at end of file From c4c22c0ea9621ddcf16d9c567c60fdc070416c30 Mon Sep 17 00:00:00 2001 From: Ramnath Vaidyanathan Date: Tue, 22 Jan 2013 11:49:35 -0500 Subject: [PATCH 2/3] remove .Rhistory files --- 001courseLogistics/.Rhistory | 512 --------------------------------- 002gettingHelp/.Rhistory | 437 ---------------------------- 003whatIsData/.Rhistory | 512 --------------------------------- 004representingData/.Rhistory | 512 --------------------------------- 005representingDataR/.Rhistory | 437 ---------------------------- 006simulationBasics/.Rhistory | 437 ---------------------------- 007typesOfQuestions/.Rhistory | 512 --------------------------------- 008sourcesOfDataSets/.Rhistory | 512 --------------------------------- 8 files changed, 3871 deletions(-) delete mode 100644 001courseLogistics/.Rhistory delete mode 100644 002gettingHelp/.Rhistory delete mode 100644 003whatIsData/.Rhistory delete mode 100644 004representingData/.Rhistory delete mode 100644 005representingDataR/.Rhistory delete mode 100644 006simulationBasics/.Rhistory delete mode 100644 007typesOfQuestions/.Rhistory delete mode 100644 008sourcesOfDataSets/.Rhistory diff --git a/001courseLogistics/.Rhistory b/001courseLogistics/.Rhistory deleted file mode 100644 index 760dfa5..0000000 --- a/001courseLogistics/.Rhistory +++ /dev/null @@ -1,512 +0,0 @@ -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-4,4),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -?symbols -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -symbols(0,7.5,stars=matrix(c(1,1,1),nrow=1),col="gold") -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -symbols(0,7.5,stars=matrix(c(1,1,1,1,1),nrow=1),col="gold",add=T) -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -symbols(0,7.5,stars=matrix(c(1,1,1,1,1,1),nrow=1),col="gold",add=T) -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold") -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -?rect -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(3,-4.5,4.5) -rect(xPres-0.5,rep(0,3),xPres+0.5,runi(3,0,1),col=sample(c("blue","red"),size=3,replace=T)) -# Add some presents -xPres = runif(3,-4.5,4.5) -rect(xPres-0.5,rep(0,3),xPres+0.5,runif(3,0,1),col=sample(c("blue","red"),size=3,replace=T)) -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -rect(xPres-0.5,rep(0,10),xPres+0.5,runif(10,0,1),col=sample(c("blue","red"),size=10,replace=T)) -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0,0.5) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],rep(0,10),xPres[i]+xWidth[i],runif(10,0,1),col=sample(c("blue","red"),size=1)) -} -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0,0.5) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],0,xPres[i]+xWidth[i],runif(1,0,1),col=sample(c("blue","red"),size=1)) -} -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0,0.5) -xHeight=runif(10,0,1) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],0,xPres[i]+xWidth[i],xHeight[i],col=sample(c("blue","red"),size=1)) -rect(xPres[i]-0.1*xWidth[i],0,xPres[i]+0.1*xWidth[i],xHeight[i],col="gold") -} -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0,0.5) -xHeight=runif(10,0,1) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],0,xPres[i]+xWidth[i],xHeight[i],col=sample(c("blue","red"),size=1)) -rect(xPres[i]-0.2*xWidth[i],0,xPres[i]+0.2*xWidth[i],xHeight[i],col=sample("gold","silver")) -} -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0,0.5) -xHeight=runif(10,0,1) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],0,xPres[i]+xWidth[i],xHeight[i],col=sample(c("blue","red"),size=1)) -rect(xPres[i]-0.2*xWidth[i],0,xPres[i]+0.2*xWidth[i],xHeight[i],col=sample(c("gold","silver"),size=1) -} -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0,0.5) -xHeight=runif(10,0,1) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],0,xPres[i]+xWidth[i],xHeight[i],col=sample(c("blue","red"),size=1)) -rect(xPres[i]-0.2*xWidth[i],0,xPres[i]+0.2*xWidth[i],xHeight[i],col=sample(c("gold","silver"),size=1)) -} -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0,0.5) -xHeight=runif(10,0,1) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],0,xPres[i]+xWidth[i],xHeight[i],col=sample(c("blue","red"),size=1)) -rect(xPres[i]-0.2*xWidth[i],0,xPres[i]+0.2*xWidth[i],xHeight[i],col=sample(c("gold","grey87"),size=1)) -} -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0.1,0.5) -xHeight=runif(10,0,1) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],0,xPres[i]+xWidth[i],xHeight[i],col=sample(c("blue","red"),size=1)) -rect(xPres[i]-0.2*xWidth[i],0,xPres[i]+0.2*xWidth[i],xHeight[i],col=sample(c("gold","grey87"),size=1)) -} -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0.1,0.5) -xHeight=runif(10,0,1) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],0,xPres[i]+xWidth[i],xHeight[i],col=sample(c("blue","red"),size=1)) -rect(xPres[i]-0.2*xWidth[i],0,xPres[i]+0.2*xWidth[i],xHeight[i],col=sample(c("gold","grey87"),size=1)) -} -?png -png("xmas.png",height=2*480,width=480) - -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0.1,0.5) -xHeight=runif(10,0,1) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],0,xPres[i]+xWidth[i],xHeight[i],col=sample(c("blue","red"),size=1)) -rect(xPres[i]-0.2*xWidth[i],0,xPres[i]+0.2*xWidth[i],xHeight[i],col=sample(c("gold","grey87"),size=1)) -} -dev.off() -pvals = runif(10000) -pvals05 = pvals[pvals < 0.05] -hist(pvals05) -data() -?network -install.packages("ergm") -library(ergm) -?network -m <- matrix(rbinom(25,1,.4),5,5) -diag(m) <- 0 -g <- network(m, directed=FALSE) -summary(g) -m -ss = svd(M) -ss = svd(m) -plot(ss$v[,1]) -ss$u[,1] %*% t(ss$v[,1]) -ss$d[1]*ss$u[,1] %*% t(ss$v[,1]) -set.seed(31) -heightsCM = rnorm(10,mean=188, sd=5) -weightsK = rnorm(10,mean=84,sd=3) -hasDaughter = sample(c(TRUE,FALSE),size=10,replace=T) -myDataFrame = data.frame(heightsCM,weightsK,hasDaughter) -myDataFrame -set.seed(31) -heightsCM = rnorm(30,mean=188, sd=5) -weightsK = rnorm(30,mean=84,sd=3) -hasDaughter = sample(c(TRUE,FALSE),size=30,replace=T) -myDataFrame = data.frame(heightsCM,weightsK,hasDaughter) -set.seed(31) -heightsCM = rnorm(30,mean=188, sd=5) -weightsK = rnorm(30,mean=84,sd=3) -hasDaughter = sample(c(TRUE,FALSE),size=30,replace=T) -myDataFrame = data.frame(heightsCM,weightsK,hasDaughter) -set.seed(31) -heightsCM = rnorm(30,mean=188, sd=5) -weightsK = rnorm(30,mean=84,sd=3) -hasDaughter = sample(c(TRUE,FALSE),size=30,replace=T) -dataFrame = data.frame(heightsCM,weightsK,hasDaughter) -dataFrame -set.seed(31) -heightsCM = rnorm(30,mean=188, sd=5) -weightsK = rnorm(30,mean=84,sd=3) -hasDaughter = sample(c(TRUE,FALSE),size=30,replace=T) -dataFrame = data.frame(heightsCM,weightsK,hasDaughter) -dataFrame -set.seed(31) -heightsCM = rnorm(30,mean=188, sd=5) -weightsK = rnorm(30,mean=84,sd=3) -hasDaughter = sample(c(TRUE,FALSE),size=30,replace=T) -dataFrame = data.frame(heightsCM,weightsK,hasDaughter) -dataFrameSubset = dataFrame[dataFrame$heightsCM > 188,] -mean(dataFrameSubset$weightsK) -mean(dataFrameSubset$weightsK) -set.seed(31); heightsCM = rnorm(30,mean=188, sd=5); weightsK = rnorm(30,mean=84,sd=3); hasDaughter = sample(c(TRUE,FALSE),size=30,replace=T); dataFrame = data.frame(heightsCM,weightsK,hasDaughter); -set.seed(31); heightsCM = rnorm(30,mean=188, sd=5); weightsK = rnorm(30,mean=84,sd=3); hasDaughter = sample(c(TRUE,FALSE),size=30,replace=T); dataFrame = data.frame(heightsCM,weightsK,hasDaughter); -set.seed(31); heightsCM = rnorm(30,mean=188, sd=5); weightsK = rnorm(30,mean=84,sd=3); hasDaughter = sample(c(TRUE,FALSE),size=30,replace=T); dataFrame = data.frame(heightsCM,weightsK,hasDaughter) -dataFrameSubset = dataFrame[dataFrame$heights > 188,] -mean(dataFrameSubset$weightsK) -dataFrameSubset = dataFrame[dataFrame$heights >= 188,] -mean(dataFrameSubset$weightsK) -dataFrameSubset = dataFrame[dataFrame$heights < 188,] -mean(dataFrameSubset$weightsK) -mean(dataFrame$weightsK) -set.seed(31); heightsCM = rnorm(30,mean=188, sd=5); weightsK = rnorm(30,mean=84,sd=3); hasDaughter = sample(c(TRUE,FALSE),size=30,replace=T); dataFrame = data.frame(heightsCM,weightsK,hasDaughter); -dataFrameSubset = dataFrame[dataFrame$heights > 188,] -mean(dataFrame$weightsK) -set.seed(31); heightsCM = rnorm(30,mean=188, sd=5); weightsK = rnorm(30,mean=84,sd=3); hasDaughter = sample(c(TRUE,FALSE),size=30,replace=T); dataFrame = data.frame(heightsCM,weightsK,hasDaughter); -mean(dataFrameSubset$weightsK) -set.seed(41) -rcauchy(100) -set.seed(41) -cauchyValues = rcauchy(100) -?cauchyValues -?rcauchy -set.seed(41) -cauchyValues = rcauchy(100) -set.seed(41) -sample(cauchyValues,replace=TRUE) -set.seed(41) -cauchyValues = rcauchy(100) -set.seed(41) -sampledValues = sample(cauchyValues,size=10,replace=TRUE) -sampledValues[1:3] -set.seed(41) -cauchyValues = rcauchy(100) -set.seed(415) -sampledValues = sample(cauchyValues,size=10,replace=TRUE) -sampledValues[1:3] -set.seed(41) -cauchyValues = rcauchy(100) -#set.seed(415) -sampledValues = sample(cauchyValues,size=10,replace=TRUE) -sampledValues[1:3] -set.seed(41) -cauchyValues = rcauchy(100) -set.seed(415) -sampledValues = sample(cauchyValues,size=10,replace=FALSE) -sampledValues[1:3] -set.seed(41) -cauchyValues = rcauchy(100) -set.seed(41) -sampledValues = sample(cauchyValues,size=10,replace=TRUE) -sampledValues[1:3] -library(kernlab) -args(predict.kqr) -args(predict) -rbinom -?rnorm -getwd() -setwd(file.choose()) -setwd("~/Dropbox/Jeff/teaching/2013/coursera/") -list.files() -setwd("week1/") -setwd("001courseLogistics/") -?publish -library(slidify) -?publish -publish("001courseLogistics",host="dropbox") diff --git a/002gettingHelp/.Rhistory b/002gettingHelp/.Rhistory deleted file mode 100644 index 7955cdc..0000000 --- a/002gettingHelp/.Rhistory +++ /dev/null @@ -1,437 +0,0 @@ -text(5.5,5.5,teamName1,col ="red", family = 'Helvetica', cex = cx/1.5) -}else{ -text(5.5,5.5,teamName2,col ="blue", family = 'Helvetica', cex = cx/1.5) -} -plot(1:10,1:10,type="n",xaxt="n",yaxt="n",main=paste(teamName1,"Accuracy")) -text(5.5,5.5,paste(cumMean(trueLabels[1:i] == team1Pred[1:i]),"%"),col ="red", family = 'Helvetica', cex = cx/1.5) -plot(1:10,1:10,type="n",xaxt="n",yaxt="n",main=paste(teamName2,"Accuracy")) -text(5.5,5.5,paste(cumMean(trueLabels[1:i] == team2Pred[1:i]),"%"),col ="blue", family = 'Helvetica', cex = cx/1.5) -} -makeVideo(teamName1="JoelDan",teamName2="SarahMax", -trueLabels=battleData[battleSample,1],team1Pred=nonPCA[battleSample,"JoelDan"], -team2Pred=nonPCA[battleSample,"SarahMax"],testImages=as.matrix(battleData[battleSample,-1])) -makeVideo(teamName1="GregColin",teamName2="SarahMax", -trueLabels=battleData[battleSample,1],team1Pred=nonPCA[battleSample,"GregColin"], -team2Pred=nonPCA[battleSample,"SarahMax"],testImages=as.matrix(battleData[battleSample,-1])) -makeVideo(teamName1="GregColin",teamName2="JoelDan", -trueLabels=battleData[battleSample,1],team1Pred=nonPCA[battleSample,"GregColin"], -team2Pred=nonPCA[battleSample,"JoelDan"],testImages=as.matrix(battleData[battleSample,-1])) -names(PCA) -battleSample = sample(1:3000,size=100,replace=FALSE) -makeVideo(teamName1="GregColinPCA",teamName2="JonPhoebe", -trueLabels=battleData[battleSample,1],team1Pred=PCA[battleSample,"GregColinPCA"], -team2Pred=PCA[battleSample,"JonPhoebe"],testImages=as.matrix(battleData[battleSample,-1])) -head(PCA) -names(PCA) -battleSample = sample(1:3000,size=100,replace=FALSE) -makeVideo(teamName1="WesJoeEm",teamName2="CalebChey", -trueLabels=battleData[battleSample,1],team1Pred=PCA[battleSample,"WesJoeEm"], -team2Pred=PCA[battleSample,"CalebChey"],testImages=as.matrix(battleData[battleSample,-1])) -battleSample = sample(1:3000,size=100,replace=FALSE) -makeVideo(teamName1="JonPhoebe",teamName2="GregColin", -trueLabels=battleData[battleSample,1],team1Pred=PCA[battleSample,"JonPhoebe"], -team2Pred=nonPCA[battleSample,"GregColin"],testImages=as.matrix(battleData[battleSample,-1])) -displayTeams <- function(teamName1="The Jets",teamName2="The Sharks",cx=5,nFrames=10){ -par(mar=c(0,0,4,0),bg="black",col.main="white") -layout(matrix(c(1,1,1,2,2,2),byrow=T,nrow=2)) -colRampWhite = colorRampPalette(c("black","white"))(nFrames) -colRampRed= colorRampPalette(c("black","red"))(nFrames) -colRampBlue= colorRampPalette(c("black","blue"))(nFrames) -for(i in 1:nFrames){ -Team1 -plot(1:10,1:10,type="n") -text(5.5,5.5,teamName1,col = colRampRed[i], family = 'Helvetica', cex = cx) -Team2 -plot(1:10,1:10,type="n",main="Versus",cex.main=3) -text(5.5,5.5,teamName2,col = colRampBlue[i], family = 'Helvetica', cex = cx) -Sys.sleep(2/nFrames) -} -predictionMatch <- function(teamName1,teamName2,trueLabels,testImages,team1Pred,team2Pred,cx=8){ -par(mar=c(0,0,4,0),bg="black",col.main="white") -layout(matrix(c(2,1,4,3,0,5),byrow=T,nrow=2)) -for(i in 1:dim(testImages)[1]){ -zz = matrix(testImages[i,],nrow=28) -image(zz[,ncol(zz):1],main="True Image",xaxt="n",yaxt="n",col=colRampWhite,cex.main=3) -Sys.sleep(0.2) -plot(1:10,1:10,type="n",xaxt="n",yaxt="n",main=paste(teamName1),cex.main=3) -text(5.5,5.5,team1Pred[i],col ="red", family = 'Helvetica', cex = cx) -plot(1:10,1:10,type="n",xaxt="n",yaxt="n",main=paste("Accuracy"),cex.main=3) -text(5.5,5.5,paste(cumMean(trueLabels[1:i] == team1Pred[1:i]),"%"),col ="red", family = 'Helvetica', cex = cx/1.5) -Sys.sleep(0.2) -plot(1:10,1:10,type="n",xaxt="n",yaxt="n",main=paste(teamName2),cex.main=3) -text(5.5,5.5,team2Pred[i],col ="blue", family = 'Helvetica', cex = cx) -plot(1:10,1:10,type="n",xaxt="n",yaxt="n",main=paste("Accuracy"),cex.main=3) -text(5.5,5.5,paste(cumMean(trueLabels[1:i] == team2Pred[1:i]),"%"),col ="blue", family = 'Helvetica', cex = cx/1.5) -Sys.sleep(0.4) -} -par(mar=c(0,0,4,0),bg="black",col.main="white") -layout(matrix(c(1,1,1,2,0,3),byrow=T,nrow=2)) -plot(1:10,1:10,type="n",xaxt="n",yaxt="n",main="Winner",cex.main=3) -team1winner = cumMean(trueLabels ==team1Pred) > cumMean(trueLabels==team2Pred) -if(team1winner){ -text(5.5,5.5,teamName1,col ="red", family = 'Helvetica', cex = cx/1.5) -}else{ -text(5.5,5.5,teamName2,col ="blue", family = 'Helvetica', cex = cx/1.5) -} -plot(1:10,1:10,type="n",xaxt="n",yaxt="n",main=paste(teamName1),cex.main=3) -text(5.5,5.5,paste(cumMean(trueLabels[1:i] == team1Pred[1:i]),"%"),col ="red", family = 'Helvetica', cex = cx/1.5) -plot(1:10,1:10,type="n",xaxt="n",yaxt="n",main=paste(teamName2),cex.main=3) -text(5.5,5.5,paste(cumMean(trueLabels[1:i] == team2Pred[1:i]),"%"),col ="blue", family = 'Helvetica', cex = cx/1.5) -} -cumMean = function(x){ -return(round(mean(x)*100,1)) -} -makeVideo <- function(teamName1,teamName2,trueLabels,team1Pred,team2Pred,testImages){ -displayTeams(teamName1=teamName1,teamName2=teamName2) -predictionMatch(teamName1=teamName1,teamName2=teamName2, -trueLabels=trueLabels,team1Pred=team1Pred, -team2Pred=team2Pred,testImages=testImages) -} -nonPCA = read.csv("~/Dropbox/Leah/Teaching/SM439/SM439/Project2/nonPCAbattle.csv",header=T) -PCA = read.csv("~/Dropbox/Leah/Teaching/SM439/SM439/Project2/PCAbattle.csv",header=T) -battleData= read.csv("~/Dropbox/Leah/Teaching/SM439/SM439/Project2/battleData.csv",header=T) -battleSample = sample(1:3000,size=5,replace=FALSE) -makeVideo(teamName1="JoelDan",teamName2="SarahMax", -trueLabels=battleData[battleSample,1],team1Pred=nonPCA[battleSample,"JoelDan"], -team2Pred=nonPCA[battleSample,"SarahMax"],testImages=as.matrix(battleData[battleSample,-1])) -battleSample = sample(1:3000,size=100,replace=FALSE) -makeVideo(teamName1="JoelDan",teamName2="SarahMax", -trueLabels=battleData[battleSample,1],team1Pred=nonPCA[battleSample,"JoelDan"], -team2Pred=nonPCA[battleSample,"SarahMax"],testImages=as.matrix(battleData[battleSample,-1])) -windowsFonts() -?par -library(RCurl) library(XML) library(tm)# -# A function to get all abstracts and pubmed ids for papers from the journal "journaltitle" in the year "year" # by scraping the Pubmed API. getAbstractsPmids = function(journaltitle,year){ # esearch url <- "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?" q = paste("db=pubmed&term=",gsub(" ","+",journaltitle),"[ta]+AND+",year,"[dp]&usehistory=y",sep="") esearch <- xmlTreeParse(getURL(paste(url, q, sep="")), useInternal = T) webenv <- xmlValue(getNodeSet(esearch, "//WebEnv")[[1]]) key <- xmlValue(getNodeSet(esearch, "//QueryKey")[[1]]) # efetch url <- "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?" q <- "db=pubmed&retmode=xml&rettype=abstract" efetch <- xmlTreeParse(getURL(paste(url, q, "&WebEnv=", webenv, "&query_key=", key, sep="")), useInternal = T) r = xmlRoot(efetch) n = xmlSize(r) abstracts = pmid = titles = rep(NA,n) for(i in 1:n){abstracts[i] = xmlValue(r[[i]][[1]][["Article"]][["Abstract"]]); pmid[i] = xmlValue(r[[i]][[1]][["PMID"]]); titles[i] = xmlValue(r[[i]][[1 -]][["Article"]][["ArticleTitle"]]) } return(list(abstracts=abstracts,pmid=pmid,titles=titles)) }# -#A function to remove trailing zeros from the P-value strings removeTrailing = function(string){ while(length(grep("[0-9]",strsplit(string,"")[[1]][nchar(string)])) == 0){ string = substr(string,1,(nchar(string)-1)) } return(string) }# -# A function to convert the scientific notation used by journals into # numeric values that can be analyzed. convertScientific = function(string){ if(length(grep("[[:punct:]][[:space:]]",string))>0){ string = strsplit(string,"[[:punct:]][[:space:]]")[[1]][1] string = removeTrailing(string) } if(length(grep("[×x]",string))>0){ string = gsub("[:space:]","",string) tmp1 = as.numeric(strsplit(string,"[×x]")[[1]][1]) tmp2 = as.numeric(strsplit(strsplit(string,"[×x]")[[1]][2],"[−-]")[[1]][2]) return(tmp1*10^(-tmp2)) }else{ return(as.numeric(string)) } }# -# A function to scrape the P-values from a vector of abstracts with corresponding # pubmed ids getPvalues = function(abstract,pmid){ pvalues = numeric(0) trunc = numeric(0) ids = numeric(0) # Get the truncated p-values ind = grep("[Pp][[:space:]]?[<≤]",abstract) for(i in 1:length(ind)){ tmp = strsplit(abstract[ind[i]],"[[:space:](][Pp][[:space:]]?[<≤]")[[1]] n = length(tmp) for(j in 1:n){ if(length(grep("[.0123456789]",substr(tmp[j],1,2))) > 0){ if(length(grep("[A-Z]",substr(tmp[j],1,1)))>0){next;} tmp2 = strsplit(tmp[j],"[^[:punct:][:digit:]x[:space:]]")[[1]][1] tmp2 = removeTrailing(tmp2) tmp2 = gsub(" ","",tmp2) tmp2 = convertScientific(tmp2) pvalues = c(pvalues,as.numeric(tmp2)) trunc = c(trunc,1) ids = c(ids,pmid[ind[i]]) } } } # Get the truncated p-values ind = grep("[Pp][[:space:]]?=",abstract) for(i in 1:length(ind)){ tmp = strsplit(abstract[ind[i]],"[[:space:](][Pp][[:space:]] -?=")[[1]] n = length(tmp) for(j in 1:n){ if(length(grep("[.0123456789]",substr(tmp[j],1,2))) > 0){ if(length(grep("[A-Z]",substr(tmp[j],1,1)))>0){next;} tmp2 = strsplit(tmp[j],"[^[:punct:][:space:][:digit:]x[:space:]]")[[1]][1] tmp2 = removeTrailing(tmp2) tmp2 = gsub(" ","",tmp2) tmp2 = convertScientific(tmp2) pvalues = c(pvalues,as.numeric(tmp2)) trunc = c(trunc,0) ids = c(ids,pmid[ind[i]]) } } } return(list(pvalues=pvalues,ids=ids,trunc=trunc)) }# -## Run the above functions over a specified set of journals and years ## to obtain P-values# -journals = c("JAMA","New England Journal of Medicine","BMJ","American Journal of Epidemiology","Lancet") years = 2000:2010 pvalueData = matrix(NA,nrow=1,ncol=6) colnames(pvalueData) = c("pvalue","pvalueTruncated","pubmedID","year","abstract","title") npapers = matrix(NA,nrow=length(journals),ncol=length(years)) for(i in 1:length(journals)){ for(j in 1:length(years)){ cat(journals[i]); cat(" "); cat(years[j]); cat(" "); tmpData = getAbstractsPmids(journals[i],years[j]) while(length(tmpData$abstracts) ==1 & is.na(tmpData$abstracts[1])){tmpData = getAbstractsPmids(journals[i],years[j])} cat("Downloaded"); cat(" "); npapers[i,j] = length(tmpData$abstracts) tmpOut = getPvalues(tmpData$abstracts,tmpData$pmid)# -nPvalues = length(tmpOut$pvalues) aa = match(tmpOut$ids,tmpData$pmid)# -tmpMatrix = cbind(tmpOut$pvalues,tmpOut$trunc,as.numeric(tmpOut$ids),rep(years[j],nPvalues),tmpData$abstracts[aa],tmpData$titles[aa]) rownames(tmpMatrix) = rep(journals[i],nPvalues) pvalueData = rbind(pvalueData,tmpMatrix) cat("Done\n") } }# -## These come from the paper Pubmed ID = 20876667 and are reports from ## a GWAS. Update some P-values that are incorrectly scraped because of ## variation in scientific notation. pvalueData[pvalueData[,1] == 10,1] = 10e-7 pvalueData = pvalueData[-1,] ## These come from the Lancet, with missed periods in the P-values pvalueData[13392,1] = 0.003 pvalueData[13413,1] = 0.014 pvalueData[13414,1] = 0.004 ## This one comes from the Lancet too, where an incorrect P-value is grabbed. pvalueData = pvalueData[-14674,]# -# Remove rows with P-values that are pvalueData = pvalueData[!is.na(pvalueData[,1]),] # This one for some reason replaced a period with "small middle dot" pvalueData[which(pvalueData[,3] == 11943262),1] = 1e-4 -dim(pvalueDAta) -dim(pvalueData) -pvalueData2 = pvalueData -load("~/Downloads/pvalueData00-10.rda") -ls() -dim(pvalueData) -pvalueData[1,] -pvalueData2[1,] -names(pvalueDAta) -names(pvalueData) -names(pvalueData2) -dim(pvalueData) -dim(pvalueData2) -pvalueData2[1,] -pvalueData2[2,] -pvalueData2[1,] -pvalueData[1,] -oo = match(pvalueData$pubmedID,pvalueData2$pubmedID) -colnames(pvalueData) -colnames(pvalueData2) -oo = match(pvalueData[,3],pvalueData2[,3]) -length(oo) -oo[1] -sum(is.na(oo)) -tmp1 = pvalueData[,3] -tmp2 = pvalueData2[,3] -tmp1[1] -tmp2[1] -tmp2 = as.numeric(tmp2) -tmp1 = tmp1[order(tmp1)] -tmp2 = tmp2[order(tmp2)] -tmp1[1] -tmp2[1] -length(tmp1) -length(tmp2) -sum(tmp1[1:15653] == tmp2[1:15653]) -tmp1[13427:13428] -tmp1[13427:13429] -tmp2[13427:13429] -tmp1[13425:13429] -tmp2[13425:13429] -pvalueData[1,] -pvalueData[pvalueData[,3]==19549972, ] -pvalueData2[pvalueData2[,3]=="19549972", ] -pvalueData2[pvalueData2[,3]=="19549973", ] -tmp2[13425:13429] -tmp2[13424:13429] -tmp1[13424:13429] -sum(tmp1[1:13424] == tmp2[1:13424]) -sum(tmp1[1:11940] == tmp2[1:11940]) -plot(tmp1,tmp2) -length(tmp2) -plot(tmp1,tmp2[1:15653]) -t1 = table(tmp1) -t2 = table(tmp2) -t1[1] -t2[1] -sum(t1 == t2) -length(t2) -length(t1) -setdiff(names(t1),names(t2)) -sum(t1 == t2[1:5323]) -oo = match(names(t1),names(t2)) -length(oo) -oo[1] -oo = match(names(t2),names(t1)) -length(oo) -sum(is.na(oo)) -which(is.na(oo)) -length(names(t2)) -t2[3097] -sum(t2) -dim(pvalueData) -dim(pvalueData2) -pvalueData2[pvalueData2[,3]=="16421237",] -pvalueData3 = pvalueData2[-which(pvalueData2[,3]=="16421237"),] -dim(pvalueData3) -dim(pvalueData) -tmp1 = pvalueData3[,3] -tmp2 = pvalueData[,3] -length(tmp1) -length(tmp2) -tmp1[1] -tmp2[1] -tmp1 = as.numeric(tmp1) -tmp1 = tmp1[order(tmp1)] -tmp2 = tmp2[order(tmp2)] -tmp1[1] -tmp2[1] -plot(tmp1,tmp2) -sum(tmp1==tmp2) -mean(tmp1==tmp2) -tmp1 = pvalueData3[,3]# -tmp2 = pvalueData[,3] -tmp1[1] -tmp1 = as.numeric(tmp1) -colnames(pvalueData3) -pvals1 = as.numeric(pvalueData3[,1]) -pvals2 = as.numeric(pvalueData[,1]) -pvals1[1] -pvals2[1] -pvals1 = pvals1[order(tmp1)] -pvals2 = pvals1[order(tmp2)] -sum(pvals1==pvals2) -length(pvals1) -ne = which(pvals1!=pvals2) -ne[1] -pvals1 = as.numeric(pvalueData3[,1]) -pvals2 = as.numeric(pvalueData[,1]) -pvals1 = pvals1[order(tmp1)] -pvals2 = pvals2[order(tmp2)] -sum(pvals1==pvals2) -length(pvals1) -mean(pvals1==pvals2) -mean((pvals1 - pvals2) < 1e-3) -mean((pvals1 - pvals2) < 1e-5) -mean(abs(pvals1 - pvals2) < 1e-5 ) -dim(pvalueData) -dim(pvalueData3) -rm(list=ls()) -Functions to scrape P-values from Pubmed abstracts # Date: 7-1-12 # Copyright (C) 2011 Jeffrey T. Leek (http://www.biostat.jhsph.edu/~jleek/contact.html) and Leah R. Jager # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details, see . # # # Note: These functions were written on a Mac and may have difficulties when # read on windows machines. # ######################################################################################### -library(RCurl) library(XML) library(tm)# -# A function to get all abstracts and pubmed ids for papers from the journal "journaltitle" in the year "year" # by scraping the Pubmed API. getAbstractsPmids = function(journaltitle,year){ # esearch url <- "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?" q = paste("db=pubmed&term=",gsub(" ","+",journaltitle),"[ta]+AND+",year,"[dp]&usehistory=y",sep="") esearch <- xmlTreeParse(getURL(paste(url, q, sep="")), useInternal = T) webenv <- xmlValue(getNodeSet(esearch, "//WebEnv")[[1]]) key <- xmlValue(getNodeSet(esearch, "//QueryKey")[[1]]) # efetch url <- "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?" q <- "db=pubmed&retmode=xml&rettype=abstract" efetch <- xmlTreeParse(getURL(paste(url, q, "&WebEnv=", webenv, "&query_key=", key, sep="")), useInternal = T) r = xmlRoot(efetch) n = xmlSize(r) abstracts = pmid = titles = rep(NA,n) for(i in 1:n){abstracts[i] = xmlValue(r[[i]][[1]][["Article"]][["Abstract"]]); pmid[i] = xmlValue(r[[i]][[1]][["PMID"]]); titles[i] = xmlValue(r[[i]][[1 -]][["Article"]][["ArticleTitle"]]) } return(list(abstracts=abstracts,pmid=pmid,titles=titles)) }# -#A function to remove trailing zeros from the P-value strings removeTrailing = function(string){ while(length(grep("[0-9]",strsplit(string,"")[[1]][nchar(string)])) == 0){ string = substr(string,1,(nchar(string)-1)) } return(string) }# -# A function to convert the scientific notation used by journals into # numeric values that can be analyzed. convertScientific = function(string){ if(length(grep("[[:punct:]][[:space:]]",string))>0){ string = strsplit(string,"[[:punct:]][[:space:]]")[[1]][1] string = removeTrailing(string) } if(length(grep("[×x]",string))>0){ string = gsub("[:space:]","",string) tmp1 = as.numeric(strsplit(string,"[×x]")[[1]][1]) tmp2 = as.numeric(strsplit(strsplit(string,"[×x]")[[1]][2],"[−-]")[[1]][2]) return(tmp1*10^(-tmp2)) }else{ return(as.numeric(string)) } }# -# A function to scrape the P-values from a vector of abstracts with corresponding # pubmed ids getPvalues = function(abstract,pmid){ pvalues = numeric(0) trunc = numeric(0) ids = numeric(0) # Get the truncated p-values ind = grep("[Pp][[:space:]]?[<≤]",abstract) for(i in 1:length(ind)){ tmp = strsplit(abstract[ind[i]],"[[:space:](][Pp][[:space:]]?[<≤]")[[1]] n = length(tmp) for(j in 1:n){ if(length(grep("[.0123456789]",substr(tmp[j],1,2))) > 0){ if(length(grep("[A-Z]",substr(tmp[j],1,1)))>0){next;} tmp2 = strsplit(tmp[j],"[^[:punct:][:digit:]x[:space:]]")[[1]][1] tmp2 = removeTrailing(tmp2) tmp2 = gsub(" ","",tmp2) tmp2 = convertScientific(tmp2) pvalues = c(pvalues,as.numeric(tmp2)) trunc = c(trunc,1) ids = c(ids,pmid[ind[i]]) } } } # Get the truncated p-values ind = grep("[Pp][[:space:]]?=",abstract) for(i in 1:length(ind)){ tmp = strsplit(abstract[ind[i]],"[[:space:](][Pp][[:space:]] -?=")[[1]] n = length(tmp) for(j in 1:n){ if(length(grep("[.0123456789]",substr(tmp[j],1,2))) > 0){ if(length(grep("[A-Z]",substr(tmp[j],1,1)))>0){next;} tmp2 = strsplit(tmp[j],"[^[:punct:][:space:][:digit:]x[:space:]]")[[1]][1] tmp2 = removeTrailing(tmp2) tmp2 = gsub(" ","",tmp2) tmp2 = convertScientific(tmp2) pvalues = c(pvalues,as.numeric(tmp2)) trunc = c(trunc,0) ids = c(ids,pmid[ind[i]]) } } } return(list(pvalues=pvalues,ids=ids,trunc=trunc)) }# -## Run the above functions over a specified set of journals and years ## to obtain P-values# -journals = c("JAMA","New England Journal of Medicine","BMJ","American Journal of Epidemiology","Lancet") years = 2000:2010 pvalueData = matrix(NA,nrow=1,ncol=6) colnames(pvalueData) = c("pvalue","pvalueTruncated","pubmedID","year","abstract","title") npapers = matrix(NA,nrow=length(journals),ncol=length(years)) for(i in 1:length(journals)){ for(j in 1:length(years)){ cat(journals[i]); cat(" "); cat(years[j]); cat(" "); tmpData = getAbstractsPmids(journals[i],years[j]) while(length(tmpData$abstracts) ==1 & is.na(tmpData$abstracts[1])){tmpData = getAbstractsPmids(journals[i],years[j])} cat("Downloaded"); cat(" "); npapers[i,j] = length(tmpData$abstracts) tmpOut = getPvalues(tmpData$abstracts,tmpData$pmid)# -nPvalues = length(tmpOut$pvalues) aa = match(tmpOut$ids,tmpData$pmid)# -tmpMatrix = cbind(tmpOut$pvalues,tmpOut$trunc,as.numeric(tmpOut$ids),rep(years[j],nPvalues),tmpData$abstracts[aa],tmpData$titles[aa]) rownames(tmpMatrix) = rep(journals[i],nPvalues) pvalueData = rbind(pvalueData,tmpMatrix) cat("Done\n") } }# -## These come from the paper Pubmed ID = 20876667 and are reports from ## a GWAS. Update some P-values that are incorrectly scraped because of ## variation in scientific notation. pvalueData[pvalueData[,1] == 10,1] = 10e-7 pvalueData = pvalueData[-1,] ## These come from the Lancet, with missed periods in the P-values pvalueData[13392,1] = 0.003 pvalueData[13413,1] = 0.014 pvalueData[13414,1] = 0.004 ## This one comes from the Lancet too, where an incorrect P-value is grabbed. pvalueData = pvalueData[-14674,]# -# Remove rows with P-values that are pvalueData = pvalueData[!is.na(pvalueData[,1]),] # This one for some reason replaced a period with "small middle dot" pvalueData[which(pvalueData[,3] == 11943262),1] = 1e-4 # This one has a <<< in the P-value definition pvalueData = pvalueData[-which(pvalueData[,3]=="16421237"),] # -save(pvalueData,npapers,file="pvalueDataTest.rda") -dim(pvalueData) -rm(list=ls()) -pvalueData[13413,1] = 0.014 pvalueData[13414,1] = 0.004 ## This one comes from the Lancet too, where an incorrect P-value is grabbed. pvalueData = pvalueData[-14674,]# -# Remove rows with P-values that are pvalueData = pvalueData[!is.na(pvalueData[,1]),] # This one for some reason replaced a period with "small middle dot" pvalueData[which(pvalueData[,3] == 11943262),1] = 1e-4 # This one has a <<< in the P-value definition pvalueData = pvalueData[-which(pvalueData[,3]=="16421237"),] # -save(pvalueData,npapers,file="pvalueDataTest.rda") -Functions to scrape P-values from Pubmed abstracts # Date: 7-1-12 # Copyright (C) 2011 Jeffrey T. Leek (http://www.biostat.jhsph.edu/~jleek/contact.html) and Leah R. Jager # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details, see . # # # Note: These functions were written on a Mac and may have difficulties when # read on windows machines. # ######################################################################################### -library(RCurl) library(XML) library(tm)# -# A function to get all abstracts and pubmed ids for papers from the journal "journaltitle" in the year "year" # by scraping the Pubmed API. getAbstractsPmids = function(journaltitle,year){ # esearch url <- "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?" q = paste("db=pubmed&term=",gsub(" ","+",journaltitle),"[ta]+AND+",year,"[dp]&usehistory=y",sep="") esearch <- xmlTreeParse(getURL(paste(url, q, sep="")), useInternal = T) webenv <- xmlValue(getNodeSet(esearch, "//WebEnv")[[1]]) key <- xmlValue(getNodeSet(esearch, "//QueryKey")[[1]]) # efetch url <- "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?" q <- "db=pubmed&retmode=xml&rettype=abstract" efetch <- xmlTreeParse(getURL(paste(url, q, "&WebEnv=", webenv, "&query_key=", key, sep="")), useInternal = T) r = xmlRoot(efetch) n = xmlSize(r) abstracts = pmid = titles = rep(NA,n) for(i in 1:n){abstracts[i] = xmlValue(r[[i]][[1]][["Article"]][["Abstract"]]); pmid[i] = xmlValue(r[[i]][[1]][["PMID"]]); titles[i] = xmlValue(r[[i]][[1 -]][["Article"]][["ArticleTitle"]]) } return(list(abstracts=abstracts,pmid=pmid,titles=titles)) }# -#A function to remove trailing zeros from the P-value strings removeTrailing = function(string){ while(length(grep("[0-9]",strsplit(string,"")[[1]][nchar(string)])) == 0){ string = substr(string,1,(nchar(string)-1)) } return(string) }# -# A function to convert the scientific notation used by journals into # numeric values that can be analyzed. convertScientific = function(string){ if(length(grep("[[:punct:]][[:space:]]",string))>0){ string = strsplit(string,"[[:punct:]][[:space:]]")[[1]][1] string = removeTrailing(string) } if(length(grep("[×x]",string))>0){ string = gsub("[:space:]","",string) tmp1 = as.numeric(strsplit(string,"[×x]")[[1]][1]) tmp2 = as.numeric(strsplit(strsplit(string,"[×x]")[[1]][2],"[−-]")[[1]][2]) return(tmp1*10^(-tmp2)) }else{ return(as.numeric(string)) } }# -# A function to scrape the P-values from a vector of abstracts with corresponding # pubmed ids getPvalues = function(abstract,pmid){ pvalues = numeric(0) trunc = numeric(0) ids = numeric(0) # Get the truncated p-values ind = grep("[Pp][[:space:]]?[<≤]",abstract) for(i in 1:length(ind)){ tmp = strsplit(abstract[ind[i]],"[[:space:](][Pp][[:space:]]?[<≤]")[[1]] n = length(tmp) for(j in 1:n){ if(length(grep("[.0123456789]",substr(tmp[j],1,2))) > 0){ if(length(grep("[A-Z]",substr(tmp[j],1,1)))>0){next;} tmp2 = strsplit(tmp[j],"[^[:punct:][:digit:]x[:space:]]")[[1]][1] tmp2 = removeTrailing(tmp2) tmp2 = gsub(" ","",tmp2) tmp2 = convertScientific(tmp2) pvalues = c(pvalues,as.numeric(tmp2)) trunc = c(trunc,1) ids = c(ids,pmid[ind[i]]) } } } # Get the truncated p-values ind = grep("[Pp][[:space:]]?=",abstract) for(i in 1:length(ind)){ tmp = strsplit(abstract[ind[i]],"[[:space:](][Pp][[:space:]] -?=")[[1]] n = length(tmp) for(j in 1:n){ if(length(grep("[.0123456789]",substr(tmp[j],1,2))) > 0){ if(length(grep("[A-Z]",substr(tmp[j],1,1)))>0){next;} tmp2 = strsplit(tmp[j],"[^[:punct:][:space:][:digit:]x[:space:]]")[[1]][1] tmp2 = removeTrailing(tmp2) tmp2 = gsub(" ","",tmp2) tmp2 = convertScientific(tmp2) pvalues = c(pvalues,as.numeric(tmp2)) trunc = c(trunc,0) ids = c(ids,pmid[ind[i]]) } } } return(list(pvalues=pvalues,ids=ids,trunc=trunc)) }# -## Run the above functions over a specified set of journals and years ## to obtain P-values# -journals = c("JAMA","New England Journal of Medicine","BMJ","American Journal of Epidemiology","Lancet") years = 2000:2010 pvalueData = matrix(NA,nrow=1,ncol=6) colnames(pvalueData) = c("pvalue","pvalueTruncated","pubmedID","year","abstract","title") npapers = matrix(NA,nrow=length(journals),ncol=length(years)) for(i in 1:length(journals)){ for(j in 1:length(years)){ cat(journals[i]); cat(" "); cat(years[j]); cat(" "); tmpData = getAbstractsPmids(journals[i],years[j]) while(length(tmpData$abstracts) ==1 & is.na(tmpData$abstracts[1])){tmpData = getAbstractsPmids(journals[i],years[j])} cat("Downloaded"); cat(" "); npapers[i,j] = length(tmpData$abstracts) tmpOut = getPvalues(tmpData$abstracts,tmpData$pmid)# -nPvalues = length(tmpOut$pvalues) aa = match(tmpOut$ids,tmpData$pmid)# -tmpMatrix = cbind(tmpOut$pvalues,tmpOut$trunc,as.numeric(tmpOut$ids),rep(years[j],nPvalues),tmpData$abstracts[aa],tmpData$titles[aa]) rownames(tmpMatrix) = rep(journals[i],nPvalues) pvalueData = rbind(pvalueData,tmpMatrix) cat("Done\n") } }# -## These come from the paper Pubmed ID = 20876667 and are reports from ## a GWAS. Update some P-values that are incorrectly scraped because of ## variation in scientific notation. pvalueData[pvalueData[,1] == 10,1] = 10e-7 pvalueData = pvalueData[-1,] ## These come from the Lancet, with missed periods in the P-values pvalueData[13392,1] = 0.003 pvalueData[13413,1] = 0.014 pvalueData[13414,1] = 0.004 ## This one comes from the Lancet too, where an incorrect P-value is grabbed. pvalueData = pvalueData[-14674,]# -# Remove rows with P-values that are pvalueData = pvalueData[!is.na(pvalueData[,1]),] # This one for some reason replaced a period with "small middle dot" pvalueData[which(pvalueData[,3] == 11943262),1] = 1e-4 # This one has a <<< in the P-value definition pvalueData = pvalueData[-which(pvalueData[,3]=="16421237"),] # -save(pvalueData,npapers,file="pvalueDataTest.rda") -Functions to scrape P-values from Pubmed abstracts # Date: 7-1-12 # Copyright (C) 2011 Jeffrey T. Leek (http://www.biostat.jhsph.edu/~jleek/contact.html) and Leah R. Jager # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details, see . # # # Note: These functions were written on a Mac and may have difficulties when # read on windows machines. # ######################################################################################### -library(RCurl) library(XML) library(tm)# -# A function to get all abstracts and pubmed ids for papers from the journal "journaltitle" in the year "year" # by scraping the Pubmed API. getAbstractsPmids = function(journaltitle,year){ # esearch url <- "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?" q = paste("db=pubmed&term=",gsub(" ","+",journaltitle),"[ta]+AND+",year,"[dp]&usehistory=y",sep="") esearch <- xmlTreeParse(getURL(paste(url, q, sep="")), useInternal = T) webenv <- xmlValue(getNodeSet(esearch, "//WebEnv")[[1]]) key <- xmlValue(getNodeSet(esearch, "//QueryKey")[[1]]) # efetch url <- "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?" q <- "db=pubmed&retmode=xml&rettype=abstract" efetch <- xmlTreeParse(getURL(paste(url, q, "&WebEnv=", webenv, "&query_key=", key, sep="")), useInternal = T) r = xmlRoot(efetch) n = xmlSize(r) abstracts = pmid = titles = rep(NA,n) for(i in 1:n){abstracts[i] = xmlValue(r[[i]][[1]][["Article"]][["Abstract"]]); pmid[i] = xmlValue(r[[i]][[1]][["PMID"]]); titles[i] = xmlValue(r[[i]][[1 -]][["Article"]][["ArticleTitle"]]) } return(list(abstracts=abstracts,pmid=pmid,titles=titles)) }# -#A function to remove trailing zeros from the P-value strings removeTrailing = function(string){ while(length(grep("[0-9]",strsplit(string,"")[[1]][nchar(string)])) == 0){ string = substr(string,1,(nchar(string)-1)) } return(string) }# -# A function to convert the scientific notation used by journals into # numeric values that can be analyzed. convertScientific = function(string){ if(length(grep("[[:punct:]][[:space:]]",string))>0){ string = strsplit(string,"[[:punct:]][[:space:]]")[[1]][1] string = removeTrailing(string) } if(length(grep("[×x]",string))>0){ string = gsub("[:space:]","",string) tmp1 = as.numeric(strsplit(string,"[×x]")[[1]][1]) tmp2 = as.numeric(strsplit(strsplit(string,"[×x]")[[1]][2],"[−-]")[[1]][2]) return(tmp1*10^(-tmp2)) }else{ return(as.numeric(string)) } }# -# A function to scrape the P-values from a vector of abstracts with corresponding # pubmed ids getPvalues = function(abstract,pmid){ pvalues = numeric(0) trunc = numeric(0) ids = numeric(0) # Get the truncated p-values ind = grep("[Pp][[:space:]]?[<≤]",abstract) for(i in 1:length(ind)){ tmp = strsplit(abstract[ind[i]],"[[:space:](][Pp][[:space:]]?[<≤]")[[1]] n = length(tmp) for(j in 1:n){ if(length(grep("[.0123456789]",substr(tmp[j],1,2))) > 0){ if(length(grep("[A-Z]",substr(tmp[j],1,1)))>0){next;} tmp2 = strsplit(tmp[j],"[^[:punct:][:digit:]x[:space:]]")[[1]][1] tmp2 = removeTrailing(tmp2) tmp2 = gsub(" ","",tmp2) tmp2 = convertScientific(tmp2) pvalues = c(pvalues,as.numeric(tmp2)) trunc = c(trunc,1) ids = c(ids,pmid[ind[i]]) } } } # Get the truncated p-values ind = grep("[Pp][[:space:]]?=",abstract) for(i in 1:length(ind)){ tmp = strsplit(abstract[ind[i]],"[[:space:](][Pp][[:space:]] -?=")[[1]] n = length(tmp) for(j in 1:n){ if(length(grep("[.0123456789]",substr(tmp[j],1,2))) > 0){ if(length(grep("[A-Z]",substr(tmp[j],1,1)))>0){next;} tmp2 = strsplit(tmp[j],"[^[:punct:][:space:][:digit:]x[:space:]]")[[1]][1] tmp2 = removeTrailing(tmp2) tmp2 = gsub(" ","",tmp2) tmp2 = convertScientific(tmp2) pvalues = c(pvalues,as.numeric(tmp2)) trunc = c(trunc,0) ids = c(ids,pmid[ind[i]]) } } } return(list(pvalues=pvalues,ids=ids,trunc=trunc)) }# -## Run the above functions over a specified set of journals and years ## to obtain P-values# -journals = c("JAMA","New England Journal of Medicine","BMJ","American Journal of Epidemiology","Lancet") years = 2000:2010 pvalueData = matrix(NA,nrow=1,ncol=6) colnames(pvalueData) = c("pvalue","pvalueTruncated","pubmedID","year","abstract","title") npapers = matrix(NA,nrow=length(journals),ncol=length(years)) for(i in 1:length(journals)){ for(j in 1:length(years)){ cat(journals[i]); cat(" "); cat(years[j]); cat(" "); tmpData = getAbstractsPmids(journals[i],years[j]) while(length(tmpData$abstracts) ==1 & is.na(tmpData$abstracts[1])){tmpData = getAbstractsPmids(journals[i],years[j])} cat("Downloaded"); cat(" "); npapers[i,j] = length(tmpData$abstracts) tmpOut = getPvalues(tmpData$abstracts,tmpData$pmid)# -nPvalues = length(tmpOut$pvalues) aa = match(tmpOut$ids,tmpData$pmid)# -tmpMatrix = cbind(tmpOut$pvalues,tmpOut$trunc,as.numeric(tmpOut$ids),rep(years[j],nPvalues),tmpData$abstracts[aa],tmpData$titles[aa]) rownames(tmpMatrix) = rep(journals[i],nPvalues) pvalueData = rbind(pvalueData,tmpMatrix) cat("Done\n") } }# -## These come from the paper Pubmed ID = 20876667 and are reports from ## a GWAS. Update some P-values that are incorrectly scraped because of ## variation in scientific notation. pvalueData[pvalueData[,1] == 10,1] = 10e-7 pvalueData = pvalueData[-1,] ## These come from the Lancet, with missed periods in the P-values pvalueData[13392,1] = 0.003 pvalueData[13413,1] = 0.014 pvalueData[13414,1] = 0.004 ## This one comes from the Lancet too, where an incorrect P-value is grabbed. pvalueData = pvalueData[-14674,]# -# Remove rows with P-values that are pvalueData = pvalueData[!is.na(pvalueData[,1]),] # This one for some reason replaced a period with "small middle dot" pvalueData[which(pvalueData[,3] == 11943262),1] = 1e-4 # This one has a <<< in the P-value definition pvalueData = pvalueData[-which(pvalueData[,3]=="16421237"),] # -save(pvalueData,npapers,file="pvalueData.rda") -Functions to scrape P-values from Pubmed abstracts # Date: 7-1-12 # Copyright (C) 2011 Jeffrey T. Leek (http://www.biostat.jhsph.edu/~jleek/contact.html) and Leah R. Jager # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details, see . # # # Note: These functions were written on a Mac and may have difficulties when # read on windows machines. # ######################################################################################### -library(RCurl) library(XML) library(tm)# -# A function to get all abstracts and pubmed ids for papers from the journal "journaltitle" in the year "year" # by scraping the Pubmed API. getAbstractsPmids = function(journaltitle,year){ # esearch url <- "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?" q = paste("db=pubmed&term=",gsub(" ","+",journaltitle),"[ta]+AND+",year,"[dp]&usehistory=y",sep="") esearch <- xmlTreeParse(getURL(paste(url, q, sep="")), useInternal = T) webenv <- xmlValue(getNodeSet(esearch, "//WebEnv")[[1]]) key <- xmlValue(getNodeSet(esearch, "//QueryKey")[[1]]) # efetch url <- "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?" q <- "db=pubmed&retmode=xml&rettype=abstract" efetch <- xmlTreeParse(getURL(paste(url, q, "&WebEnv=", webenv, "&query_key=", key, sep="")), useInternal = T) r = xmlRoot(efetch) n = xmlSize(r) abstracts = pmid = titles = rep(NA,n) for(i in 1:n){abstracts[i] = xmlValue(r[[i]][[1]][["Article"]][["Abstract"]]); pmid[i] = xmlValue(r[[i]][[1]][["PMID"]]); titles[i] = xmlValue(r[[i]][[1 -]][["Article"]][["ArticleTitle"]]) } return(list(abstracts=abstracts,pmid=pmid,titles=titles)) }# -#A function to remove trailing zeros from the P-value strings removeTrailing = function(string){ while(length(grep("[0-9]",strsplit(string,"")[[1]][nchar(string)])) == 0){ string = substr(string,1,(nchar(string)-1)) } return(string) }# -# A function to convert the scientific notation used by journals into # numeric values that can be analyzed. convertScientific = function(string){ if(length(grep("[[:punct:]][[:space:]]",string))>0){ string = strsplit(string,"[[:punct:]][[:space:]]")[[1]][1] string = removeTrailing(string) } if(length(grep("[×x]",string))>0){ string = gsub("[:space:]","",string) tmp1 = as.numeric(strsplit(string,"[×x]")[[1]][1]) tmp2 = as.numeric(strsplit(strsplit(string,"[×x]")[[1]][2],"[−-]")[[1]][2]) return(tmp1*10^(-tmp2)) }else{ return(as.numeric(string)) } }# -# A function to scrape the P-values from a vector of abstracts with corresponding # pubmed ids getPvalues = function(abstract,pmid){ pvalues = numeric(0) trunc = numeric(0) ids = numeric(0) # Get the truncated p-values ind = grep("[Pp][[:space:]]?[<≤]",abstract) for(i in 1:length(ind)){ tmp = strsplit(abstract[ind[i]],"[[:space:](][Pp][[:space:]]?[<≤]")[[1]] n = length(tmp) for(j in 1:n){ if(length(grep("[.0123456789]",substr(tmp[j],1,2))) > 0){ if(length(grep("[A-Z]",substr(tmp[j],1,1)))>0){next;} tmp2 = strsplit(tmp[j],"[^[:punct:][:digit:]x[:space:]]")[[1]][1] tmp2 = removeTrailing(tmp2) tmp2 = gsub(" ","",tmp2) tmp2 = convertScientific(tmp2) pvalues = c(pvalues,as.numeric(tmp2)) trunc = c(trunc,1) ids = c(ids,pmid[ind[i]]) } } } # Get the truncated p-values ind = grep("[Pp][[:space:]]?=",abstract) for(i in 1:length(ind)){ tmp = strsplit(abstract[ind[i]],"[[:space:](][Pp][[:space:]] -?=")[[1]] n = length(tmp) for(j in 1:n){ if(length(grep("[.0123456789]",substr(tmp[j],1,2))) > 0){ if(length(grep("[A-Z]",substr(tmp[j],1,1)))>0){next;} tmp2 = strsplit(tmp[j],"[^[:punct:][:space:][:digit:]x[:space:]]")[[1]][1] tmp2 = removeTrailing(tmp2) tmp2 = gsub(" ","",tmp2) tmp2 = convertScientific(tmp2) pvalues = c(pvalues,as.numeric(tmp2)) trunc = c(trunc,0) ids = c(ids,pmid[ind[i]]) } } } return(list(pvalues=pvalues,ids=ids,trunc=trunc)) }# -## Run the above functions over a specified set of journals and years ## to obtain P-values# -journals = c("JAMA","New England Journal of Medicine","BMJ","American Journal of Epidemiology","Lancet") years = 2000:2010 pvalueData = matrix(NA,nrow=1,ncol=6) colnames(pvalueData) = c("pvalue","pvalueTruncated","pubmedID","year","abstract","title") npapers = matrix(NA,nrow=length(journals),ncol=length(years)) for(i in 1:length(journals)){ for(j in 1:length(years)){ cat(journals[i]); cat(" "); cat(years[j]); cat(" "); tmpData = getAbstractsPmids(journals[i],years[j]) while(length(tmpData$abstracts) ==1 & is.na(tmpData$abstracts[1])){tmpData = getAbstractsPmids(journals[i],years[j])} cat("Downloaded"); cat(" "); npapers[i,j] = length(tmpData$abstracts) tmpOut = getPvalues(tmpData$abstracts,tmpData$pmid)# -nPvalues = length(tmpOut$pvalues) aa = match(tmpOut$ids,tmpData$pmid)# -tmpMatrix = cbind(tmpOut$pvalues,tmpOut$trunc,as.numeric(tmpOut$ids),rep(years[j],nPvalues),tmpData$abstracts[aa],tmpData$titles[aa]) rownames(tmpMatrix) = rep(journals[i],nPvalues) pvalueData = rbind(pvalueData,tmpMatrix) cat("Done\n") } }# -## These come from the paper Pubmed ID = 20876667 and are reports from ## a GWAS. Update some P-values that are incorrectly scraped because of ## variation in scientific notation. pvalueData[pvalueData[,1] == 10,1] = 10e-7 pvalueData = pvalueData[-1,] ## These come from the Lancet, with missed periods in the P-values pvalueData[13392,1] = 0.003 pvalueData[13413,1] = 0.014 pvalueData[13414,1] = 0.004 ## This one comes from the Lancet too, where an incorrect P-value is grabbed. pvalueData = pvalueData[-14674,]# -# Remove rows with P-values that are pvalueData = pvalueData[!is.na(pvalueData[,1]),] # This one for some reason replaced a period with "small middle dot" pvalueData[which(pvalueData[,3] == 11943262),1] = 1e-4 # This one has a <<< in the P-value definition pvalueData = pvalueData[-which(pvalueData[,3]=="16421237"),] # -save(pvalueData,npapers,file="pvalueData.rda") -Functions to scrape P-values from Pubmed abstracts # Date: 7-1-12 # Copyright (C) 2011 Jeffrey T. Leek (http://www.biostat.jhsph.edu/~jleek/contact.html) and Leah R. Jager # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details, see . # # # Note: These functions were written on a Mac and may have difficulties when # read on windows machines. # ######################################################################################### -library(RCurl) library(XML) library(tm)# -# A function to get all abstracts and pubmed ids for papers from the journal "journaltitle" in the year "year" # by scraping the Pubmed API. getAbstractsPmids = function(journaltitle,year){ # esearch url <- "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?" q = paste("db=pubmed&term=",gsub(" ","+",journaltitle),"[ta]+AND+",year,"[dp]&usehistory=y",sep="") esearch <- xmlTreeParse(getURL(paste(url, q, sep="")), useInternal = T) webenv <- xmlValue(getNodeSet(esearch, "//WebEnv")[[1]]) key <- xmlValue(getNodeSet(esearch, "//QueryKey")[[1]]) # efetch url <- "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?" q <- "db=pubmed&retmode=xml&rettype=abstract" efetch <- xmlTreeParse(getURL(paste(url, q, "&WebEnv=", webenv, "&query_key=", key, sep="")), useInternal = T) r = xmlRoot(efetch) n = xmlSize(r) abstracts = pmid = titles = rep(NA,n) for(i in 1:n){abstracts[i] = xmlValue(r[[i]][[1]][["Article"]][["Abstract"]]); pmid[i] = xmlValue(r[[i]][[1]][["PMID"]]); titles[i] = xmlValue(r[[i]][[1 -]][["Article"]][["ArticleTitle"]]) } return(list(abstracts=abstracts,pmid=pmid,titles=titles)) }# -#A function to remove trailing zeros from the P-value strings removeTrailing = function(string){ while(length(grep("[0-9]",strsplit(string,"")[[1]][nchar(string)])) == 0){ string = substr(string,1,(nchar(string)-1)) } return(string) }# -# A function to convert the scientific notation used by journals into # numeric values that can be analyzed. convertScientific = function(string){ if(length(grep("[[:punct:]][[:space:]]",string))>0){ string = strsplit(string,"[[:punct:]][[:space:]]")[[1]][1] string = removeTrailing(string) } if(length(grep("[×x]",string))>0){ string = gsub("[:space:]","",string) tmp1 = as.numeric(strsplit(string,"[×x]")[[1]][1]) tmp2 = as.numeric(strsplit(strsplit(string,"[×x]")[[1]][2],"[−-]")[[1]][2]) return(tmp1*10^(-tmp2)) }else{ return(as.numeric(string)) } }# -# A function to scrape the P-values from a vector of abstracts with corresponding # pubmed ids getPvalues = function(abstract,pmid){ pvalues = numeric(0) trunc = numeric(0) ids = numeric(0) # Get the truncated p-values ind = grep("[Pp][[:space:]]?[<≤]",abstract) for(i in 1:length(ind)){ tmp = strsplit(abstract[ind[i]],"[[:space:](][Pp][[:space:]]?[<≤]")[[1]] n = length(tmp) for(j in 1:n){ if(length(grep("[.0123456789]",substr(tmp[j],1,2))) > 0){ if(length(grep("[A-Z]",substr(tmp[j],1,1)))>0){next;} tmp2 = strsplit(tmp[j],"[^[:punct:][:digit:]x[:space:]]")[[1]][1] tmp2 = removeTrailing(tmp2) tmp2 = gsub(" ","",tmp2) tmp2 = convertScientific(tmp2) pvalues = c(pvalues,as.numeric(tmp2)) trunc = c(trunc,1) ids = c(ids,pmid[ind[i]]) } } } # Get the truncated p-values ind = grep("[Pp][[:space:]]?=",abstract) for(i in 1:length(ind)){ tmp = strsplit(abstract[ind[i]],"[[:space:](][Pp][[:space:]] -?=")[[1]] n = length(tmp) for(j in 1:n){ if(length(grep("[.0123456789]",substr(tmp[j],1,2))) > 0){ if(length(grep("[A-Z]",substr(tmp[j],1,1)))>0){next;} tmp2 = strsplit(tmp[j],"[^[:punct:][:space:][:digit:]x[:space:]]")[[1]][1] tmp2 = removeTrailing(tmp2) tmp2 = gsub(" ","",tmp2) tmp2 = convertScientific(tmp2) pvalues = c(pvalues,as.numeric(tmp2)) trunc = c(trunc,0) ids = c(ids,pmid[ind[i]]) } } } return(list(pvalues=pvalues,ids=ids,trunc=trunc)) }# -## Run the above functions over a specified set of journals and years ## to obtain P-values# -journals = c("JAMA","New England Journal of Medicine","BMJ","American Journal of Epidemiology","Lancet") years = 2000:2010 pvalueData = matrix(NA,nrow=1,ncol=6) colnames(pvalueData) = c("pvalue","pvalueTruncated","pubmedID","year","abstract","title") npapers = matrix(NA,nrow=length(journals),ncol=length(years)) for(i in 1:length(journals)){ for(j in 1:length(years)){ cat(journals[i]); cat(" "); cat(years[j]); cat(" "); tmpData = getAbstractsPmids(journals[i],years[j]) while(length(tmpData$abstracts) ==1 & is.na(tmpData$abstracts[1])){tmpData = getAbstractsPmids(journals[i],years[j])} cat("Downloaded"); cat(" "); npapers[i,j] = length(tmpData$abstracts) tmpOut = getPvalues(tmpData$abstracts,tmpData$pmid)# -nPvalues = length(tmpOut$pvalues) aa = match(tmpOut$ids,tmpData$pmid)# -tmpMatrix = cbind(tmpOut$pvalues,tmpOut$trunc,as.numeric(tmpOut$ids),rep(years[j],nPvalues),tmpData$abstracts[aa],tmpData$titles[aa]) rownames(tmpMatrix) = rep(journals[i],nPvalues) pvalueData = rbind(pvalueData,tmpMatrix) cat("Done\n") } } -Functions to scrape P-values from Pubmed abstracts # Date: 7-1-12 # Copyright (C) 2011 Jeffrey T. Leek (http://www.biostat.jhsph.edu/~jleek/contact.html) and Leah R. Jager # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details, see . # # # Note: These functions were written on a Mac and may have difficulties when # read on windows machines. # ######################################################################################### -library(RCurl) library(XML) library(tm)# -# A function to get all abstracts and pubmed ids for papers from the journal "journaltitle" in the year "year" # by scraping the Pubmed API. getAbstractsPmids = function(journaltitle,year){ # esearch url <- "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?" q = paste("db=pubmed&term=",gsub(" ","+",journaltitle),"[ta]+AND+",year,"[dp]&usehistory=y",sep="") esearch <- xmlTreeParse(getURL(paste(url, q, sep="")), useInternal = T) webenv <- xmlValue(getNodeSet(esearch, "//WebEnv")[[1]]) key <- xmlValue(getNodeSet(esearch, "//QueryKey")[[1]]) # efetch url <- "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?" q <- "db=pubmed&retmode=xml&rettype=abstract" efetch <- xmlTreeParse(getURL(paste(url, q, "&WebEnv=", webenv, "&query_key=", key, sep="")), useInternal = T) r = xmlRoot(efetch) n = xmlSize(r) abstracts = pmid = titles = rep(NA,n) for(i in 1:n){abstracts[i] = xmlValue(r[[i]][[1]][["Article"]][["Abstract"]]); pmid[i] = xmlValue(r[[i]][[1]][["PMID"]]); titles[i] = xmlValue(r[[i]][[1]][["Article"]][["ArticleTitle"]]) } return(list(abstracts=abstracts,pmid=pmid,titles=titles)) }# -#A function to remove trailing zeros from the P-value strings removeTrailing = function(string){ while(length(grep("[0-9]",strsplit(string,"")[[1]][nchar(string)])) == 0){ string = substr(string,1,(nchar(string)-1)) } return(string) }# -# A function to convert the scientific notation used by journals into # numeric values that can be analyzed. convertScientific = function(string){ if(length(grep("[[:punct:]][[:space:]]",string))>0){ string = strsplit(string,"[[:punct:]][[:space:]]")[[1]][1] string = removeTrailing(string) } if(length(grep("[×x]",string))>0){ string = gsub("[:space:]","",string) tmp1 = as.numeric(strsplit(string,"[×x]")[[1]][1]) tmp2 = as.numeric(strsplit(strsplit(string,"[×x]")[[1]][2],"[−-]")[[1]][2]) return(tmp1*10^(-tmp2)) }else{ return(as.numeric(string)) } }# -# A function to scrape the P-values from a vector of abstracts with corresponding # pubmed ids getPvalues = function(abstract,pmid){ pvalues = numeric(0) trunc = numeric(0) ids = numeric(0) # Get the truncated p-values ind = grep("[Pp][[:space:]]?[<≤]",abstract) for(i in 1:length(ind)){ tmp = strsplit(abstract[ind[i]],"[[:space:](][Pp][[:space:]]?[<≤]")[[1]] n = length(tmp) for(j in 1:n){ if(length(grep("[.0123456789]",substr(tmp[j],1,2))) > 0){ if(length(grep("[A-Z]",substr(tmp[j],1,1)))>0){next;} tmp2 = strsplit(tmp[j],"[^[:punct:][:digit:]x[:space:]]")[[1]][1] tmp2 = removeTrailing(tmp2) tmp2 = gsub(" ","",tmp2) tmp2 = convertScientific(tmp2) pvalues = c(pvalues,as.numeric(tmp2)) trunc = c(trunc,1) ids = c(ids,pmid[ind[i]]) } } } # Get the truncated p-values ind = grep("[Pp][[:space:]]?=",abstract) for(i in 1:length(ind)){ tmp = strsplit(abstract[ind[i]],"[[:space:](][Pp][[:space:]]?=")[[1]] n = length(tmp) for(j in 1:n){ if(length(grep("[.0123456789]",substr(tmp[j],1,2))) > 0){ if(length(grep("[A-Z]",substr(tmp[j],1,1)))>0){next;} tmp2 = strsplit(tmp[j],"[^[:punct:][:space:][:digit:]x[:space:]]")[[1]][1] tmp2 = removeTrailing(tmp2) tmp2 = gsub(" ","",tmp2) tmp2 = convertScientific(tmp2) pvalues = c(pvalues,as.numeric(tmp2)) trunc = c(trunc,0) ids = c(ids,pmid[ind[i]]) } } } return(list(pvalues=pvalues,ids=ids,trunc=trunc)) } -journals = c("JAMA","New England Journal of Medicine","BMJ","American Journal of Epidemiology","Lancet") years = 2000:2010 pvalueData = matrix(NA,nrow=1,ncol=6) colnames(pvalueData) = c("pvalue","pvalueTruncated","pubmedID","year","abstract","title") npapers = matrix(NA,nrow=length(journals),ncol=length(years)) for(i in 1:length(journals)){ for(j in 1:length(years)){ cat(journals[i]); cat(" "); cat(years[j]); cat(" "); tmpData = getAbstractsPmids(journals[i],years[j]) while(length(tmpData$abstracts) ==1 & is.na(tmpData$abstracts[1])){tmpData = getAbstractsPmids(journals[i],years[j])} cat("Downloaded"); cat(" "); npapers[i,j] = length(tmpData$abstracts) tmpOut = getPvalues(tmpData$abstracts,tmpData$pmid)# -nPvalues = length(tmpOut$pvalues) aa = match(tmpOut$ids,tmpData$pmid)# -tmpMatrix = cbind(tmpOut$pvalues,tmpOut$trunc,as.numeric(tmpOut$ids),rep(years[j],nPvalues),tmpData$abstracts[aa],tmpData$titles[aa]) rownames(tmpMatrix) = rep(journals[i],nPvalues) pvalueData = rbind(pvalueData,tmpMatrix) cat("Done\n") } } -tmpData -i -j -tmpData = getAbstractsPmids(journals[i],years[j]) -while(length(tmpData$abstracts) ==1 & is.na(tmpData$abstracts[1])){tmpData = getAbstractsPmids(journals[i],years[j])} cat("Downloaded"); cat(" "); npapers[i,j] = length(tmpData$abstracts) tmpOut = getPvalues(tmpData$abstracts,tmpData$pmid)# -nPvalues = length(tmpOut$pvalues) aa = match(tmpOut$ids,tmpData$pmid)# -tmpMatrix = cbind(tmpOut$pvalues,tmpOut$trunc,as.numeric(tmpOut$ids),rep(years[j],nPvalues),tmpData$abstracts[aa],tmpData$titles[aa]) rownames(tmpMatrix) = rep(journals[i],nPvalues) pvalueData = rbind(pvalueData,tmpMatrix) cat("Done\n") -journals = c("JAMA","New England Journal of Medicine","BMJ","American Journal of Epidemiology","Lancet") years = 2000:2010 pvalueData = matrix(NA,nrow=1,ncol=6) colnames(pvalueData) = c("pvalue","pvalueTruncated","pubmedID","year","abstract","title") npapers = matrix(NA,nrow=length(journals),ncol=length(years)) for(i in 1:length(journals)){ for(j in 1:length(years)){ cat(journals[i]); cat(" "); cat(years[j]); cat(" "); tmpData = getAbstractsPmids(journals[i],years[j]) while(length(tmpData$abstracts) ==1 & is.na(tmpData$abstracts[1])){tmpData = getAbstractsPmids(journals[i],years[j])} cat("Downloaded"); cat(" "); npapers[i,j] = length(tmpData$abstracts) tmpOut = getPvalues(tmpData$abstracts,tmpData$pmid)# -nPvalues = length(tmpOut$pvalues) aa = match(tmpOut$ids,tmpData$pmid)# -tmpMatrix = cbind(tmpOut$pvalues,tmpOut$trunc,as.numeric(tmpOut$ids),rep(years[j],nPvalues),tmpData$abstracts[aa],tmpData$titles[aa]) rownames(tmpMatrix) = rep(journals[i],nPvalues) pvalueData = rbind(pvalueData,tmpMatrix) cat("Done\n") } } -barplot(c(1,1,-3)) -?barplot -pres12 = read.csv("~/Desktop/2012-pres.csv") -pres12[1,] -pres08 = read.csv("~/Desktop/2008pres.csv") -pres08[1,] -sum(pres12$FIPS == 0) -table(pres12$X[pres12$FIPS==0,]) -table(pres12$X[pres12$FIPS==0]) -pres12[pres12$X=="OK",] -pres12 = pres12[pres12$FIPS==0,] -dim(pres12) -pres12[1,] -pres12[2,] -pres12 = read.csv("~/Desktop/2012-pres.csv") -pres12[1:10,] -pres12[21:30,] -pres12[50:100,] -pres12 = pres12[pres12$FIPS==0,] -length(unique(pres12$X)) -which.max(pres12$X == "OK") -which(pres12$X == "OK") -pres12[c(36,37)] -pres12[c(36,37),] -pres12[1,] -pres12[1,5] -pres12[1,4] -as.numeric(pres12[1,4]) -as.numeric(as.character(pres12[1,4]) -) -as.numeric(as.character(pres12[1,4])) -pres08[1,] -sum(pres08$LAST.NAME == "McCain") -sum(pres08$LAST.NAME == "McCain" & pres08$STATE=="Alabama") -pres08[pres08$LAST.NAME == "McCain",] -pres12 = read.csv("~/Desktop/2012-pres.csv") -pres12 = pres12[pres12$FIPS==0,] -pres12[1,] -table(unique(pres12)) -table(unique(pres12$x)) -table(unique(pres12$X)) -substr -gsub -gsub(pres12[1,3]) -pres12[1,] -pres12$Obama.vote[1] -dem12 = as.character(pres12$Obama.vote) -dem12[1] -dem12 = sapply(dem12,function(x){gsub(x,",","")}) -dem12[1] -dem12 = as.character(pres12$Obama.vote) -gsub(dem12[1],",","") -?gsub -gsub(",","",dem12[1]) -dem12 = as.character(pres12$Obama.vote) -dem12 = as.numeric(sapply(dem12,function(x){gsub(",","",x)})) -dem12[1] -hist(dem12) -pres12 = read.csv("~/Desktop/2012-pres.csv") -pres12 = pres12[pres12$FIPS==0,] -dem12 = as.character(pres12$Obama.vote) -dem12 = as.numeric(sapply(dem12,function(x){gsub(",","",x)})) -rep12 = as.character(pres12$Romney.vote) -rep12 = as.numeric(sapply(rep12,function(x){gsub(",","",x)})) -plot(rep12,dem12) -rep12[1] -pres12[1,] -table(pres12[,2]) -res12 = read.csv("~/Desktop/2012-pres.csv") -pres12 = pres12[pres12$FIPS==0,] -table(pres12[,2]) -table(pres12[,1]) -library(XML) -theurl <- "http://uselectionatlas.org/RESULTS/data.php?year=2008&datatype=national&def=1&f=0&off=0&elect=0" -tables <- readHTMLTable(theurl) -tables[1,] -dim(tables) -tables[1] -tables -n.rows <- unlist(lapply(tables, function(t) dim(t)[1])) -n.rows -library(slidify) -?author -setwd("~/Documents/Work/teaching/2013/coursera/") -ls() -list.files() -author("gettingStarted") -slidify("gettingStarted") -ls() -list.files() -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -setwd("~/Documents/Work/teaching/2013/coursera/") -setwd("week1/gettingHelp/") -slidify("index.Rmd") -library(slidify) -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") diff --git a/003whatIsData/.Rhistory b/003whatIsData/.Rhistory deleted file mode 100644 index 95c1638..0000000 --- a/003whatIsData/.Rhistory +++ /dev/null @@ -1,512 +0,0 @@ -points(x=runif(4,-4,4),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3) -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-4,4),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-4,4),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -?symbols -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -symbols(0,7.5,stars=matrix(c(1,1,1),nrow=1),col="gold") -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -symbols(0,7.5,stars=matrix(c(1,1,1,1,1),nrow=1),col="gold",add=T) -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -symbols(0,7.5,stars=matrix(c(1,1,1,1,1,1),nrow=1),col="gold",add=T) -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold") -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -?rect -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(3,-4.5,4.5) -rect(xPres-0.5,rep(0,3),xPres+0.5,runi(3,0,1),col=sample(c("blue","red"),size=3,replace=T)) -# Add some presents -xPres = runif(3,-4.5,4.5) -rect(xPres-0.5,rep(0,3),xPres+0.5,runif(3,0,1),col=sample(c("blue","red"),size=3,replace=T)) -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -rect(xPres-0.5,rep(0,10),xPres+0.5,runif(10,0,1),col=sample(c("blue","red"),size=10,replace=T)) -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0,0.5) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],rep(0,10),xPres[i]+xWidth[i],runif(10,0,1),col=sample(c("blue","red"),size=1)) -} -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0,0.5) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],0,xPres[i]+xWidth[i],runif(1,0,1),col=sample(c("blue","red"),size=1)) -} -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0,0.5) -xHeight=runif(10,0,1) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],0,xPres[i]+xWidth[i],xHeight[i],col=sample(c("blue","red"),size=1)) -rect(xPres[i]-0.1*xWidth[i],0,xPres[i]+0.1*xWidth[i],xHeight[i],col="gold") -} -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0,0.5) -xHeight=runif(10,0,1) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],0,xPres[i]+xWidth[i],xHeight[i],col=sample(c("blue","red"),size=1)) -rect(xPres[i]-0.2*xWidth[i],0,xPres[i]+0.2*xWidth[i],xHeight[i],col=sample("gold","silver")) -} -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0,0.5) -xHeight=runif(10,0,1) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],0,xPres[i]+xWidth[i],xHeight[i],col=sample(c("blue","red"),size=1)) -rect(xPres[i]-0.2*xWidth[i],0,xPres[i]+0.2*xWidth[i],xHeight[i],col=sample(c("gold","silver"),size=1) -} -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0,0.5) -xHeight=runif(10,0,1) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],0,xPres[i]+xWidth[i],xHeight[i],col=sample(c("blue","red"),size=1)) -rect(xPres[i]-0.2*xWidth[i],0,xPres[i]+0.2*xWidth[i],xHeight[i],col=sample(c("gold","silver"),size=1)) -} -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0,0.5) -xHeight=runif(10,0,1) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],0,xPres[i]+xWidth[i],xHeight[i],col=sample(c("blue","red"),size=1)) -rect(xPres[i]-0.2*xWidth[i],0,xPres[i]+0.2*xWidth[i],xHeight[i],col=sample(c("gold","grey87"),size=1)) -} -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0.1,0.5) -xHeight=runif(10,0,1) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],0,xPres[i]+xWidth[i],xHeight[i],col=sample(c("blue","red"),size=1)) -rect(xPres[i]-0.2*xWidth[i],0,xPres[i]+0.2*xWidth[i],xHeight[i],col=sample(c("gold","grey87"),size=1)) -} -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0.1,0.5) -xHeight=runif(10,0,1) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],0,xPres[i]+xWidth[i],xHeight[i],col=sample(c("blue","red"),size=1)) -rect(xPres[i]-0.2*xWidth[i],0,xPres[i]+0.2*xWidth[i],xHeight[i],col=sample(c("gold","grey87"),size=1)) -} -?png -png("xmas.png",height=2*480,width=480) - -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0.1,0.5) -xHeight=runif(10,0,1) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],0,xPres[i]+xWidth[i],xHeight[i],col=sample(c("blue","red"),size=1)) -rect(xPres[i]-0.2*xWidth[i],0,xPres[i]+0.2*xWidth[i],xHeight[i],col=sample(c("gold","grey87"),size=1)) -} -dev.off() -pvals = runif(10000) -pvals05 = pvals[pvals < 0.05] -hist(pvals05) -data() -?network -install.packages("ergm") -library(ergm) -?network -m <- matrix(rbinom(25,1,.4),5,5) -diag(m) <- 0 -g <- network(m, directed=FALSE) -summary(g) -m -ss = svd(M) -ss = svd(m) -plot(ss$v[,1]) -ss$u[,1] %*% t(ss$v[,1]) -ss$d[1]*ss$u[,1] %*% t(ss$v[,1]) -x = 3 asdfa -setwd("~/Documents/Work/teaching/2013/coursera/") -setwd("week1/gettingHelp/") -slidify("index.Rmd") -library(slidify) -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -setwd("../whatIsData/") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -browseURL("index.html") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -browseURL("index.html") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") diff --git a/004representingData/.Rhistory b/004representingData/.Rhistory deleted file mode 100644 index 95c1638..0000000 --- a/004representingData/.Rhistory +++ /dev/null @@ -1,512 +0,0 @@ -points(x=runif(4,-4,4),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3) -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-4,4),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-4,4),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -?symbols -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -symbols(0,7.5,stars=matrix(c(1,1,1),nrow=1),col="gold") -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -symbols(0,7.5,stars=matrix(c(1,1,1,1,1),nrow=1),col="gold",add=T) -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -symbols(0,7.5,stars=matrix(c(1,1,1,1,1,1),nrow=1),col="gold",add=T) -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold") -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -?rect -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(3,-4.5,4.5) -rect(xPres-0.5,rep(0,3),xPres+0.5,runi(3,0,1),col=sample(c("blue","red"),size=3,replace=T)) -# Add some presents -xPres = runif(3,-4.5,4.5) -rect(xPres-0.5,rep(0,3),xPres+0.5,runif(3,0,1),col=sample(c("blue","red"),size=3,replace=T)) -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -rect(xPres-0.5,rep(0,10),xPres+0.5,runif(10,0,1),col=sample(c("blue","red"),size=10,replace=T)) -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0,0.5) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],rep(0,10),xPres[i]+xWidth[i],runif(10,0,1),col=sample(c("blue","red"),size=1)) -} -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0,0.5) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],0,xPres[i]+xWidth[i],runif(1,0,1),col=sample(c("blue","red"),size=1)) -} -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0,0.5) -xHeight=runif(10,0,1) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],0,xPres[i]+xWidth[i],xHeight[i],col=sample(c("blue","red"),size=1)) -rect(xPres[i]-0.1*xWidth[i],0,xPres[i]+0.1*xWidth[i],xHeight[i],col="gold") -} -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0,0.5) -xHeight=runif(10,0,1) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],0,xPres[i]+xWidth[i],xHeight[i],col=sample(c("blue","red"),size=1)) -rect(xPres[i]-0.2*xWidth[i],0,xPres[i]+0.2*xWidth[i],xHeight[i],col=sample("gold","silver")) -} -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0,0.5) -xHeight=runif(10,0,1) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],0,xPres[i]+xWidth[i],xHeight[i],col=sample(c("blue","red"),size=1)) -rect(xPres[i]-0.2*xWidth[i],0,xPres[i]+0.2*xWidth[i],xHeight[i],col=sample(c("gold","silver"),size=1) -} -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0,0.5) -xHeight=runif(10,0,1) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],0,xPres[i]+xWidth[i],xHeight[i],col=sample(c("blue","red"),size=1)) -rect(xPres[i]-0.2*xWidth[i],0,xPres[i]+0.2*xWidth[i],xHeight[i],col=sample(c("gold","silver"),size=1)) -} -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0,0.5) -xHeight=runif(10,0,1) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],0,xPres[i]+xWidth[i],xHeight[i],col=sample(c("blue","red"),size=1)) -rect(xPres[i]-0.2*xWidth[i],0,xPres[i]+0.2*xWidth[i],xHeight[i],col=sample(c("gold","grey87"),size=1)) -} -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0.1,0.5) -xHeight=runif(10,0,1) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],0,xPres[i]+xWidth[i],xHeight[i],col=sample(c("blue","red"),size=1)) -rect(xPres[i]-0.2*xWidth[i],0,xPres[i]+0.2*xWidth[i],xHeight[i],col=sample(c("gold","grey87"),size=1)) -} -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0.1,0.5) -xHeight=runif(10,0,1) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],0,xPres[i]+xWidth[i],xHeight[i],col=sample(c("blue","red"),size=1)) -rect(xPres[i]-0.2*xWidth[i],0,xPres[i]+0.2*xWidth[i],xHeight[i],col=sample(c("gold","grey87"),size=1)) -} -?png -png("xmas.png",height=2*480,width=480) - -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0.1,0.5) -xHeight=runif(10,0,1) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],0,xPres[i]+xWidth[i],xHeight[i],col=sample(c("blue","red"),size=1)) -rect(xPres[i]-0.2*xWidth[i],0,xPres[i]+0.2*xWidth[i],xHeight[i],col=sample(c("gold","grey87"),size=1)) -} -dev.off() -pvals = runif(10000) -pvals05 = pvals[pvals < 0.05] -hist(pvals05) -data() -?network -install.packages("ergm") -library(ergm) -?network -m <- matrix(rbinom(25,1,.4),5,5) -diag(m) <- 0 -g <- network(m, directed=FALSE) -summary(g) -m -ss = svd(M) -ss = svd(m) -plot(ss$v[,1]) -ss$u[,1] %*% t(ss$v[,1]) -ss$d[1]*ss$u[,1] %*% t(ss$v[,1]) -x = 3 asdfa -setwd("~/Documents/Work/teaching/2013/coursera/") -setwd("week1/gettingHelp/") -slidify("index.Rmd") -library(slidify) -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -setwd("../whatIsData/") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -browseURL("index.html") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -browseURL("index.html") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") diff --git a/005representingDataR/.Rhistory b/005representingDataR/.Rhistory deleted file mode 100644 index 7955cdc..0000000 --- a/005representingDataR/.Rhistory +++ /dev/null @@ -1,437 +0,0 @@ -text(5.5,5.5,teamName1,col ="red", family = 'Helvetica', cex = cx/1.5) -}else{ -text(5.5,5.5,teamName2,col ="blue", family = 'Helvetica', cex = cx/1.5) -} -plot(1:10,1:10,type="n",xaxt="n",yaxt="n",main=paste(teamName1,"Accuracy")) -text(5.5,5.5,paste(cumMean(trueLabels[1:i] == team1Pred[1:i]),"%"),col ="red", family = 'Helvetica', cex = cx/1.5) -plot(1:10,1:10,type="n",xaxt="n",yaxt="n",main=paste(teamName2,"Accuracy")) -text(5.5,5.5,paste(cumMean(trueLabels[1:i] == team2Pred[1:i]),"%"),col ="blue", family = 'Helvetica', cex = cx/1.5) -} -makeVideo(teamName1="JoelDan",teamName2="SarahMax", -trueLabels=battleData[battleSample,1],team1Pred=nonPCA[battleSample,"JoelDan"], -team2Pred=nonPCA[battleSample,"SarahMax"],testImages=as.matrix(battleData[battleSample,-1])) -makeVideo(teamName1="GregColin",teamName2="SarahMax", -trueLabels=battleData[battleSample,1],team1Pred=nonPCA[battleSample,"GregColin"], -team2Pred=nonPCA[battleSample,"SarahMax"],testImages=as.matrix(battleData[battleSample,-1])) -makeVideo(teamName1="GregColin",teamName2="JoelDan", -trueLabels=battleData[battleSample,1],team1Pred=nonPCA[battleSample,"GregColin"], -team2Pred=nonPCA[battleSample,"JoelDan"],testImages=as.matrix(battleData[battleSample,-1])) -names(PCA) -battleSample = sample(1:3000,size=100,replace=FALSE) -makeVideo(teamName1="GregColinPCA",teamName2="JonPhoebe", -trueLabels=battleData[battleSample,1],team1Pred=PCA[battleSample,"GregColinPCA"], -team2Pred=PCA[battleSample,"JonPhoebe"],testImages=as.matrix(battleData[battleSample,-1])) -head(PCA) -names(PCA) -battleSample = sample(1:3000,size=100,replace=FALSE) -makeVideo(teamName1="WesJoeEm",teamName2="CalebChey", -trueLabels=battleData[battleSample,1],team1Pred=PCA[battleSample,"WesJoeEm"], -team2Pred=PCA[battleSample,"CalebChey"],testImages=as.matrix(battleData[battleSample,-1])) -battleSample = sample(1:3000,size=100,replace=FALSE) -makeVideo(teamName1="JonPhoebe",teamName2="GregColin", -trueLabels=battleData[battleSample,1],team1Pred=PCA[battleSample,"JonPhoebe"], -team2Pred=nonPCA[battleSample,"GregColin"],testImages=as.matrix(battleData[battleSample,-1])) -displayTeams <- function(teamName1="The Jets",teamName2="The Sharks",cx=5,nFrames=10){ -par(mar=c(0,0,4,0),bg="black",col.main="white") -layout(matrix(c(1,1,1,2,2,2),byrow=T,nrow=2)) -colRampWhite = colorRampPalette(c("black","white"))(nFrames) -colRampRed= colorRampPalette(c("black","red"))(nFrames) -colRampBlue= colorRampPalette(c("black","blue"))(nFrames) -for(i in 1:nFrames){ -Team1 -plot(1:10,1:10,type="n") -text(5.5,5.5,teamName1,col = colRampRed[i], family = 'Helvetica', cex = cx) -Team2 -plot(1:10,1:10,type="n",main="Versus",cex.main=3) -text(5.5,5.5,teamName2,col = colRampBlue[i], family = 'Helvetica', cex = cx) -Sys.sleep(2/nFrames) -} -predictionMatch <- function(teamName1,teamName2,trueLabels,testImages,team1Pred,team2Pred,cx=8){ -par(mar=c(0,0,4,0),bg="black",col.main="white") -layout(matrix(c(2,1,4,3,0,5),byrow=T,nrow=2)) -for(i in 1:dim(testImages)[1]){ -zz = matrix(testImages[i,],nrow=28) -image(zz[,ncol(zz):1],main="True Image",xaxt="n",yaxt="n",col=colRampWhite,cex.main=3) -Sys.sleep(0.2) -plot(1:10,1:10,type="n",xaxt="n",yaxt="n",main=paste(teamName1),cex.main=3) -text(5.5,5.5,team1Pred[i],col ="red", family = 'Helvetica', cex = cx) -plot(1:10,1:10,type="n",xaxt="n",yaxt="n",main=paste("Accuracy"),cex.main=3) -text(5.5,5.5,paste(cumMean(trueLabels[1:i] == team1Pred[1:i]),"%"),col ="red", family = 'Helvetica', cex = cx/1.5) -Sys.sleep(0.2) -plot(1:10,1:10,type="n",xaxt="n",yaxt="n",main=paste(teamName2),cex.main=3) -text(5.5,5.5,team2Pred[i],col ="blue", family = 'Helvetica', cex = cx) -plot(1:10,1:10,type="n",xaxt="n",yaxt="n",main=paste("Accuracy"),cex.main=3) -text(5.5,5.5,paste(cumMean(trueLabels[1:i] == team2Pred[1:i]),"%"),col ="blue", family = 'Helvetica', cex = cx/1.5) -Sys.sleep(0.4) -} -par(mar=c(0,0,4,0),bg="black",col.main="white") -layout(matrix(c(1,1,1,2,0,3),byrow=T,nrow=2)) -plot(1:10,1:10,type="n",xaxt="n",yaxt="n",main="Winner",cex.main=3) -team1winner = cumMean(trueLabels ==team1Pred) > cumMean(trueLabels==team2Pred) -if(team1winner){ -text(5.5,5.5,teamName1,col ="red", family = 'Helvetica', cex = cx/1.5) -}else{ -text(5.5,5.5,teamName2,col ="blue", family = 'Helvetica', cex = cx/1.5) -} -plot(1:10,1:10,type="n",xaxt="n",yaxt="n",main=paste(teamName1),cex.main=3) -text(5.5,5.5,paste(cumMean(trueLabels[1:i] == team1Pred[1:i]),"%"),col ="red", family = 'Helvetica', cex = cx/1.5) -plot(1:10,1:10,type="n",xaxt="n",yaxt="n",main=paste(teamName2),cex.main=3) -text(5.5,5.5,paste(cumMean(trueLabels[1:i] == team2Pred[1:i]),"%"),col ="blue", family = 'Helvetica', cex = cx/1.5) -} -cumMean = function(x){ -return(round(mean(x)*100,1)) -} -makeVideo <- function(teamName1,teamName2,trueLabels,team1Pred,team2Pred,testImages){ -displayTeams(teamName1=teamName1,teamName2=teamName2) -predictionMatch(teamName1=teamName1,teamName2=teamName2, -trueLabels=trueLabels,team1Pred=team1Pred, -team2Pred=team2Pred,testImages=testImages) -} -nonPCA = read.csv("~/Dropbox/Leah/Teaching/SM439/SM439/Project2/nonPCAbattle.csv",header=T) -PCA = read.csv("~/Dropbox/Leah/Teaching/SM439/SM439/Project2/PCAbattle.csv",header=T) -battleData= read.csv("~/Dropbox/Leah/Teaching/SM439/SM439/Project2/battleData.csv",header=T) -battleSample = sample(1:3000,size=5,replace=FALSE) -makeVideo(teamName1="JoelDan",teamName2="SarahMax", -trueLabels=battleData[battleSample,1],team1Pred=nonPCA[battleSample,"JoelDan"], -team2Pred=nonPCA[battleSample,"SarahMax"],testImages=as.matrix(battleData[battleSample,-1])) -battleSample = sample(1:3000,size=100,replace=FALSE) -makeVideo(teamName1="JoelDan",teamName2="SarahMax", -trueLabels=battleData[battleSample,1],team1Pred=nonPCA[battleSample,"JoelDan"], -team2Pred=nonPCA[battleSample,"SarahMax"],testImages=as.matrix(battleData[battleSample,-1])) -windowsFonts() -?par -library(RCurl) library(XML) library(tm)# -# A function to get all abstracts and pubmed ids for papers from the journal "journaltitle" in the year "year" # by scraping the Pubmed API. getAbstractsPmids = function(journaltitle,year){ # esearch url <- "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?" q = paste("db=pubmed&term=",gsub(" ","+",journaltitle),"[ta]+AND+",year,"[dp]&usehistory=y",sep="") esearch <- xmlTreeParse(getURL(paste(url, q, sep="")), useInternal = T) webenv <- xmlValue(getNodeSet(esearch, "//WebEnv")[[1]]) key <- xmlValue(getNodeSet(esearch, "//QueryKey")[[1]]) # efetch url <- "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?" q <- "db=pubmed&retmode=xml&rettype=abstract" efetch <- xmlTreeParse(getURL(paste(url, q, "&WebEnv=", webenv, "&query_key=", key, sep="")), useInternal = T) r = xmlRoot(efetch) n = xmlSize(r) abstracts = pmid = titles = rep(NA,n) for(i in 1:n){abstracts[i] = xmlValue(r[[i]][[1]][["Article"]][["Abstract"]]); pmid[i] = xmlValue(r[[i]][[1]][["PMID"]]); titles[i] = xmlValue(r[[i]][[1 -]][["Article"]][["ArticleTitle"]]) } return(list(abstracts=abstracts,pmid=pmid,titles=titles)) }# -#A function to remove trailing zeros from the P-value strings removeTrailing = function(string){ while(length(grep("[0-9]",strsplit(string,"")[[1]][nchar(string)])) == 0){ string = substr(string,1,(nchar(string)-1)) } return(string) }# -# A function to convert the scientific notation used by journals into # numeric values that can be analyzed. convertScientific = function(string){ if(length(grep("[[:punct:]][[:space:]]",string))>0){ string = strsplit(string,"[[:punct:]][[:space:]]")[[1]][1] string = removeTrailing(string) } if(length(grep("[×x]",string))>0){ string = gsub("[:space:]","",string) tmp1 = as.numeric(strsplit(string,"[×x]")[[1]][1]) tmp2 = as.numeric(strsplit(strsplit(string,"[×x]")[[1]][2],"[−-]")[[1]][2]) return(tmp1*10^(-tmp2)) }else{ return(as.numeric(string)) } }# -# A function to scrape the P-values from a vector of abstracts with corresponding # pubmed ids getPvalues = function(abstract,pmid){ pvalues = numeric(0) trunc = numeric(0) ids = numeric(0) # Get the truncated p-values ind = grep("[Pp][[:space:]]?[<≤]",abstract) for(i in 1:length(ind)){ tmp = strsplit(abstract[ind[i]],"[[:space:](][Pp][[:space:]]?[<≤]")[[1]] n = length(tmp) for(j in 1:n){ if(length(grep("[.0123456789]",substr(tmp[j],1,2))) > 0){ if(length(grep("[A-Z]",substr(tmp[j],1,1)))>0){next;} tmp2 = strsplit(tmp[j],"[^[:punct:][:digit:]x[:space:]]")[[1]][1] tmp2 = removeTrailing(tmp2) tmp2 = gsub(" ","",tmp2) tmp2 = convertScientific(tmp2) pvalues = c(pvalues,as.numeric(tmp2)) trunc = c(trunc,1) ids = c(ids,pmid[ind[i]]) } } } # Get the truncated p-values ind = grep("[Pp][[:space:]]?=",abstract) for(i in 1:length(ind)){ tmp = strsplit(abstract[ind[i]],"[[:space:](][Pp][[:space:]] -?=")[[1]] n = length(tmp) for(j in 1:n){ if(length(grep("[.0123456789]",substr(tmp[j],1,2))) > 0){ if(length(grep("[A-Z]",substr(tmp[j],1,1)))>0){next;} tmp2 = strsplit(tmp[j],"[^[:punct:][:space:][:digit:]x[:space:]]")[[1]][1] tmp2 = removeTrailing(tmp2) tmp2 = gsub(" ","",tmp2) tmp2 = convertScientific(tmp2) pvalues = c(pvalues,as.numeric(tmp2)) trunc = c(trunc,0) ids = c(ids,pmid[ind[i]]) } } } return(list(pvalues=pvalues,ids=ids,trunc=trunc)) }# -## Run the above functions over a specified set of journals and years ## to obtain P-values# -journals = c("JAMA","New England Journal of Medicine","BMJ","American Journal of Epidemiology","Lancet") years = 2000:2010 pvalueData = matrix(NA,nrow=1,ncol=6) colnames(pvalueData) = c("pvalue","pvalueTruncated","pubmedID","year","abstract","title") npapers = matrix(NA,nrow=length(journals),ncol=length(years)) for(i in 1:length(journals)){ for(j in 1:length(years)){ cat(journals[i]); cat(" "); cat(years[j]); cat(" "); tmpData = getAbstractsPmids(journals[i],years[j]) while(length(tmpData$abstracts) ==1 & is.na(tmpData$abstracts[1])){tmpData = getAbstractsPmids(journals[i],years[j])} cat("Downloaded"); cat(" "); npapers[i,j] = length(tmpData$abstracts) tmpOut = getPvalues(tmpData$abstracts,tmpData$pmid)# -nPvalues = length(tmpOut$pvalues) aa = match(tmpOut$ids,tmpData$pmid)# -tmpMatrix = cbind(tmpOut$pvalues,tmpOut$trunc,as.numeric(tmpOut$ids),rep(years[j],nPvalues),tmpData$abstracts[aa],tmpData$titles[aa]) rownames(tmpMatrix) = rep(journals[i],nPvalues) pvalueData = rbind(pvalueData,tmpMatrix) cat("Done\n") } }# -## These come from the paper Pubmed ID = 20876667 and are reports from ## a GWAS. Update some P-values that are incorrectly scraped because of ## variation in scientific notation. pvalueData[pvalueData[,1] == 10,1] = 10e-7 pvalueData = pvalueData[-1,] ## These come from the Lancet, with missed periods in the P-values pvalueData[13392,1] = 0.003 pvalueData[13413,1] = 0.014 pvalueData[13414,1] = 0.004 ## This one comes from the Lancet too, where an incorrect P-value is grabbed. pvalueData = pvalueData[-14674,]# -# Remove rows with P-values that are pvalueData = pvalueData[!is.na(pvalueData[,1]),] # This one for some reason replaced a period with "small middle dot" pvalueData[which(pvalueData[,3] == 11943262),1] = 1e-4 -dim(pvalueDAta) -dim(pvalueData) -pvalueData2 = pvalueData -load("~/Downloads/pvalueData00-10.rda") -ls() -dim(pvalueData) -pvalueData[1,] -pvalueData2[1,] -names(pvalueDAta) -names(pvalueData) -names(pvalueData2) -dim(pvalueData) -dim(pvalueData2) -pvalueData2[1,] -pvalueData2[2,] -pvalueData2[1,] -pvalueData[1,] -oo = match(pvalueData$pubmedID,pvalueData2$pubmedID) -colnames(pvalueData) -colnames(pvalueData2) -oo = match(pvalueData[,3],pvalueData2[,3]) -length(oo) -oo[1] -sum(is.na(oo)) -tmp1 = pvalueData[,3] -tmp2 = pvalueData2[,3] -tmp1[1] -tmp2[1] -tmp2 = as.numeric(tmp2) -tmp1 = tmp1[order(tmp1)] -tmp2 = tmp2[order(tmp2)] -tmp1[1] -tmp2[1] -length(tmp1) -length(tmp2) -sum(tmp1[1:15653] == tmp2[1:15653]) -tmp1[13427:13428] -tmp1[13427:13429] -tmp2[13427:13429] -tmp1[13425:13429] -tmp2[13425:13429] -pvalueData[1,] -pvalueData[pvalueData[,3]==19549972, ] -pvalueData2[pvalueData2[,3]=="19549972", ] -pvalueData2[pvalueData2[,3]=="19549973", ] -tmp2[13425:13429] -tmp2[13424:13429] -tmp1[13424:13429] -sum(tmp1[1:13424] == tmp2[1:13424]) -sum(tmp1[1:11940] == tmp2[1:11940]) -plot(tmp1,tmp2) -length(tmp2) -plot(tmp1,tmp2[1:15653]) -t1 = table(tmp1) -t2 = table(tmp2) -t1[1] -t2[1] -sum(t1 == t2) -length(t2) -length(t1) -setdiff(names(t1),names(t2)) -sum(t1 == t2[1:5323]) -oo = match(names(t1),names(t2)) -length(oo) -oo[1] -oo = match(names(t2),names(t1)) -length(oo) -sum(is.na(oo)) -which(is.na(oo)) -length(names(t2)) -t2[3097] -sum(t2) -dim(pvalueData) -dim(pvalueData2) -pvalueData2[pvalueData2[,3]=="16421237",] -pvalueData3 = pvalueData2[-which(pvalueData2[,3]=="16421237"),] -dim(pvalueData3) -dim(pvalueData) -tmp1 = pvalueData3[,3] -tmp2 = pvalueData[,3] -length(tmp1) -length(tmp2) -tmp1[1] -tmp2[1] -tmp1 = as.numeric(tmp1) -tmp1 = tmp1[order(tmp1)] -tmp2 = tmp2[order(tmp2)] -tmp1[1] -tmp2[1] -plot(tmp1,tmp2) -sum(tmp1==tmp2) -mean(tmp1==tmp2) -tmp1 = pvalueData3[,3]# -tmp2 = pvalueData[,3] -tmp1[1] -tmp1 = as.numeric(tmp1) -colnames(pvalueData3) -pvals1 = as.numeric(pvalueData3[,1]) -pvals2 = as.numeric(pvalueData[,1]) -pvals1[1] -pvals2[1] -pvals1 = pvals1[order(tmp1)] -pvals2 = pvals1[order(tmp2)] -sum(pvals1==pvals2) -length(pvals1) -ne = which(pvals1!=pvals2) -ne[1] -pvals1 = as.numeric(pvalueData3[,1]) -pvals2 = as.numeric(pvalueData[,1]) -pvals1 = pvals1[order(tmp1)] -pvals2 = pvals2[order(tmp2)] -sum(pvals1==pvals2) -length(pvals1) -mean(pvals1==pvals2) -mean((pvals1 - pvals2) < 1e-3) -mean((pvals1 - pvals2) < 1e-5) -mean(abs(pvals1 - pvals2) < 1e-5 ) -dim(pvalueData) -dim(pvalueData3) -rm(list=ls()) -Functions to scrape P-values from Pubmed abstracts # Date: 7-1-12 # Copyright (C) 2011 Jeffrey T. Leek (http://www.biostat.jhsph.edu/~jleek/contact.html) and Leah R. Jager # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details, see . # # # Note: These functions were written on a Mac and may have difficulties when # read on windows machines. # ######################################################################################### -library(RCurl) library(XML) library(tm)# -# A function to get all abstracts and pubmed ids for papers from the journal "journaltitle" in the year "year" # by scraping the Pubmed API. getAbstractsPmids = function(journaltitle,year){ # esearch url <- "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?" q = paste("db=pubmed&term=",gsub(" ","+",journaltitle),"[ta]+AND+",year,"[dp]&usehistory=y",sep="") esearch <- xmlTreeParse(getURL(paste(url, q, sep="")), useInternal = T) webenv <- xmlValue(getNodeSet(esearch, "//WebEnv")[[1]]) key <- xmlValue(getNodeSet(esearch, "//QueryKey")[[1]]) # efetch url <- "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?" q <- "db=pubmed&retmode=xml&rettype=abstract" efetch <- xmlTreeParse(getURL(paste(url, q, "&WebEnv=", webenv, "&query_key=", key, sep="")), useInternal = T) r = xmlRoot(efetch) n = xmlSize(r) abstracts = pmid = titles = rep(NA,n) for(i in 1:n){abstracts[i] = xmlValue(r[[i]][[1]][["Article"]][["Abstract"]]); pmid[i] = xmlValue(r[[i]][[1]][["PMID"]]); titles[i] = xmlValue(r[[i]][[1 -]][["Article"]][["ArticleTitle"]]) } return(list(abstracts=abstracts,pmid=pmid,titles=titles)) }# -#A function to remove trailing zeros from the P-value strings removeTrailing = function(string){ while(length(grep("[0-9]",strsplit(string,"")[[1]][nchar(string)])) == 0){ string = substr(string,1,(nchar(string)-1)) } return(string) }# -# A function to convert the scientific notation used by journals into # numeric values that can be analyzed. convertScientific = function(string){ if(length(grep("[[:punct:]][[:space:]]",string))>0){ string = strsplit(string,"[[:punct:]][[:space:]]")[[1]][1] string = removeTrailing(string) } if(length(grep("[×x]",string))>0){ string = gsub("[:space:]","",string) tmp1 = as.numeric(strsplit(string,"[×x]")[[1]][1]) tmp2 = as.numeric(strsplit(strsplit(string,"[×x]")[[1]][2],"[−-]")[[1]][2]) return(tmp1*10^(-tmp2)) }else{ return(as.numeric(string)) } }# -# A function to scrape the P-values from a vector of abstracts with corresponding # pubmed ids getPvalues = function(abstract,pmid){ pvalues = numeric(0) trunc = numeric(0) ids = numeric(0) # Get the truncated p-values ind = grep("[Pp][[:space:]]?[<≤]",abstract) for(i in 1:length(ind)){ tmp = strsplit(abstract[ind[i]],"[[:space:](][Pp][[:space:]]?[<≤]")[[1]] n = length(tmp) for(j in 1:n){ if(length(grep("[.0123456789]",substr(tmp[j],1,2))) > 0){ if(length(grep("[A-Z]",substr(tmp[j],1,1)))>0){next;} tmp2 = strsplit(tmp[j],"[^[:punct:][:digit:]x[:space:]]")[[1]][1] tmp2 = removeTrailing(tmp2) tmp2 = gsub(" ","",tmp2) tmp2 = convertScientific(tmp2) pvalues = c(pvalues,as.numeric(tmp2)) trunc = c(trunc,1) ids = c(ids,pmid[ind[i]]) } } } # Get the truncated p-values ind = grep("[Pp][[:space:]]?=",abstract) for(i in 1:length(ind)){ tmp = strsplit(abstract[ind[i]],"[[:space:](][Pp][[:space:]] -?=")[[1]] n = length(tmp) for(j in 1:n){ if(length(grep("[.0123456789]",substr(tmp[j],1,2))) > 0){ if(length(grep("[A-Z]",substr(tmp[j],1,1)))>0){next;} tmp2 = strsplit(tmp[j],"[^[:punct:][:space:][:digit:]x[:space:]]")[[1]][1] tmp2 = removeTrailing(tmp2) tmp2 = gsub(" ","",tmp2) tmp2 = convertScientific(tmp2) pvalues = c(pvalues,as.numeric(tmp2)) trunc = c(trunc,0) ids = c(ids,pmid[ind[i]]) } } } return(list(pvalues=pvalues,ids=ids,trunc=trunc)) }# -## Run the above functions over a specified set of journals and years ## to obtain P-values# -journals = c("JAMA","New England Journal of Medicine","BMJ","American Journal of Epidemiology","Lancet") years = 2000:2010 pvalueData = matrix(NA,nrow=1,ncol=6) colnames(pvalueData) = c("pvalue","pvalueTruncated","pubmedID","year","abstract","title") npapers = matrix(NA,nrow=length(journals),ncol=length(years)) for(i in 1:length(journals)){ for(j in 1:length(years)){ cat(journals[i]); cat(" "); cat(years[j]); cat(" "); tmpData = getAbstractsPmids(journals[i],years[j]) while(length(tmpData$abstracts) ==1 & is.na(tmpData$abstracts[1])){tmpData = getAbstractsPmids(journals[i],years[j])} cat("Downloaded"); cat(" "); npapers[i,j] = length(tmpData$abstracts) tmpOut = getPvalues(tmpData$abstracts,tmpData$pmid)# -nPvalues = length(tmpOut$pvalues) aa = match(tmpOut$ids,tmpData$pmid)# -tmpMatrix = cbind(tmpOut$pvalues,tmpOut$trunc,as.numeric(tmpOut$ids),rep(years[j],nPvalues),tmpData$abstracts[aa],tmpData$titles[aa]) rownames(tmpMatrix) = rep(journals[i],nPvalues) pvalueData = rbind(pvalueData,tmpMatrix) cat("Done\n") } }# -## These come from the paper Pubmed ID = 20876667 and are reports from ## a GWAS. Update some P-values that are incorrectly scraped because of ## variation in scientific notation. pvalueData[pvalueData[,1] == 10,1] = 10e-7 pvalueData = pvalueData[-1,] ## These come from the Lancet, with missed periods in the P-values pvalueData[13392,1] = 0.003 pvalueData[13413,1] = 0.014 pvalueData[13414,1] = 0.004 ## This one comes from the Lancet too, where an incorrect P-value is grabbed. pvalueData = pvalueData[-14674,]# -# Remove rows with P-values that are pvalueData = pvalueData[!is.na(pvalueData[,1]),] # This one for some reason replaced a period with "small middle dot" pvalueData[which(pvalueData[,3] == 11943262),1] = 1e-4 # This one has a <<< in the P-value definition pvalueData = pvalueData[-which(pvalueData[,3]=="16421237"),] # -save(pvalueData,npapers,file="pvalueDataTest.rda") -dim(pvalueData) -rm(list=ls()) -pvalueData[13413,1] = 0.014 pvalueData[13414,1] = 0.004 ## This one comes from the Lancet too, where an incorrect P-value is grabbed. pvalueData = pvalueData[-14674,]# -# Remove rows with P-values that are pvalueData = pvalueData[!is.na(pvalueData[,1]),] # This one for some reason replaced a period with "small middle dot" pvalueData[which(pvalueData[,3] == 11943262),1] = 1e-4 # This one has a <<< in the P-value definition pvalueData = pvalueData[-which(pvalueData[,3]=="16421237"),] # -save(pvalueData,npapers,file="pvalueDataTest.rda") -Functions to scrape P-values from Pubmed abstracts # Date: 7-1-12 # Copyright (C) 2011 Jeffrey T. Leek (http://www.biostat.jhsph.edu/~jleek/contact.html) and Leah R. Jager # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details, see . # # # Note: These functions were written on a Mac and may have difficulties when # read on windows machines. # ######################################################################################### -library(RCurl) library(XML) library(tm)# -# A function to get all abstracts and pubmed ids for papers from the journal "journaltitle" in the year "year" # by scraping the Pubmed API. getAbstractsPmids = function(journaltitle,year){ # esearch url <- "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?" q = paste("db=pubmed&term=",gsub(" ","+",journaltitle),"[ta]+AND+",year,"[dp]&usehistory=y",sep="") esearch <- xmlTreeParse(getURL(paste(url, q, sep="")), useInternal = T) webenv <- xmlValue(getNodeSet(esearch, "//WebEnv")[[1]]) key <- xmlValue(getNodeSet(esearch, "//QueryKey")[[1]]) # efetch url <- "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?" q <- "db=pubmed&retmode=xml&rettype=abstract" efetch <- xmlTreeParse(getURL(paste(url, q, "&WebEnv=", webenv, "&query_key=", key, sep="")), useInternal = T) r = xmlRoot(efetch) n = xmlSize(r) abstracts = pmid = titles = rep(NA,n) for(i in 1:n){abstracts[i] = xmlValue(r[[i]][[1]][["Article"]][["Abstract"]]); pmid[i] = xmlValue(r[[i]][[1]][["PMID"]]); titles[i] = xmlValue(r[[i]][[1 -]][["Article"]][["ArticleTitle"]]) } return(list(abstracts=abstracts,pmid=pmid,titles=titles)) }# -#A function to remove trailing zeros from the P-value strings removeTrailing = function(string){ while(length(grep("[0-9]",strsplit(string,"")[[1]][nchar(string)])) == 0){ string = substr(string,1,(nchar(string)-1)) } return(string) }# -# A function to convert the scientific notation used by journals into # numeric values that can be analyzed. convertScientific = function(string){ if(length(grep("[[:punct:]][[:space:]]",string))>0){ string = strsplit(string,"[[:punct:]][[:space:]]")[[1]][1] string = removeTrailing(string) } if(length(grep("[×x]",string))>0){ string = gsub("[:space:]","",string) tmp1 = as.numeric(strsplit(string,"[×x]")[[1]][1]) tmp2 = as.numeric(strsplit(strsplit(string,"[×x]")[[1]][2],"[−-]")[[1]][2]) return(tmp1*10^(-tmp2)) }else{ return(as.numeric(string)) } }# -# A function to scrape the P-values from a vector of abstracts with corresponding # pubmed ids getPvalues = function(abstract,pmid){ pvalues = numeric(0) trunc = numeric(0) ids = numeric(0) # Get the truncated p-values ind = grep("[Pp][[:space:]]?[<≤]",abstract) for(i in 1:length(ind)){ tmp = strsplit(abstract[ind[i]],"[[:space:](][Pp][[:space:]]?[<≤]")[[1]] n = length(tmp) for(j in 1:n){ if(length(grep("[.0123456789]",substr(tmp[j],1,2))) > 0){ if(length(grep("[A-Z]",substr(tmp[j],1,1)))>0){next;} tmp2 = strsplit(tmp[j],"[^[:punct:][:digit:]x[:space:]]")[[1]][1] tmp2 = removeTrailing(tmp2) tmp2 = gsub(" ","",tmp2) tmp2 = convertScientific(tmp2) pvalues = c(pvalues,as.numeric(tmp2)) trunc = c(trunc,1) ids = c(ids,pmid[ind[i]]) } } } # Get the truncated p-values ind = grep("[Pp][[:space:]]?=",abstract) for(i in 1:length(ind)){ tmp = strsplit(abstract[ind[i]],"[[:space:](][Pp][[:space:]] -?=")[[1]] n = length(tmp) for(j in 1:n){ if(length(grep("[.0123456789]",substr(tmp[j],1,2))) > 0){ if(length(grep("[A-Z]",substr(tmp[j],1,1)))>0){next;} tmp2 = strsplit(tmp[j],"[^[:punct:][:space:][:digit:]x[:space:]]")[[1]][1] tmp2 = removeTrailing(tmp2) tmp2 = gsub(" ","",tmp2) tmp2 = convertScientific(tmp2) pvalues = c(pvalues,as.numeric(tmp2)) trunc = c(trunc,0) ids = c(ids,pmid[ind[i]]) } } } return(list(pvalues=pvalues,ids=ids,trunc=trunc)) }# -## Run the above functions over a specified set of journals and years ## to obtain P-values# -journals = c("JAMA","New England Journal of Medicine","BMJ","American Journal of Epidemiology","Lancet") years = 2000:2010 pvalueData = matrix(NA,nrow=1,ncol=6) colnames(pvalueData) = c("pvalue","pvalueTruncated","pubmedID","year","abstract","title") npapers = matrix(NA,nrow=length(journals),ncol=length(years)) for(i in 1:length(journals)){ for(j in 1:length(years)){ cat(journals[i]); cat(" "); cat(years[j]); cat(" "); tmpData = getAbstractsPmids(journals[i],years[j]) while(length(tmpData$abstracts) ==1 & is.na(tmpData$abstracts[1])){tmpData = getAbstractsPmids(journals[i],years[j])} cat("Downloaded"); cat(" "); npapers[i,j] = length(tmpData$abstracts) tmpOut = getPvalues(tmpData$abstracts,tmpData$pmid)# -nPvalues = length(tmpOut$pvalues) aa = match(tmpOut$ids,tmpData$pmid)# -tmpMatrix = cbind(tmpOut$pvalues,tmpOut$trunc,as.numeric(tmpOut$ids),rep(years[j],nPvalues),tmpData$abstracts[aa],tmpData$titles[aa]) rownames(tmpMatrix) = rep(journals[i],nPvalues) pvalueData = rbind(pvalueData,tmpMatrix) cat("Done\n") } }# -## These come from the paper Pubmed ID = 20876667 and are reports from ## a GWAS. Update some P-values that are incorrectly scraped because of ## variation in scientific notation. pvalueData[pvalueData[,1] == 10,1] = 10e-7 pvalueData = pvalueData[-1,] ## These come from the Lancet, with missed periods in the P-values pvalueData[13392,1] = 0.003 pvalueData[13413,1] = 0.014 pvalueData[13414,1] = 0.004 ## This one comes from the Lancet too, where an incorrect P-value is grabbed. pvalueData = pvalueData[-14674,]# -# Remove rows with P-values that are pvalueData = pvalueData[!is.na(pvalueData[,1]),] # This one for some reason replaced a period with "small middle dot" pvalueData[which(pvalueData[,3] == 11943262),1] = 1e-4 # This one has a <<< in the P-value definition pvalueData = pvalueData[-which(pvalueData[,3]=="16421237"),] # -save(pvalueData,npapers,file="pvalueDataTest.rda") -Functions to scrape P-values from Pubmed abstracts # Date: 7-1-12 # Copyright (C) 2011 Jeffrey T. Leek (http://www.biostat.jhsph.edu/~jleek/contact.html) and Leah R. Jager # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details, see . # # # Note: These functions were written on a Mac and may have difficulties when # read on windows machines. # ######################################################################################### -library(RCurl) library(XML) library(tm)# -# A function to get all abstracts and pubmed ids for papers from the journal "journaltitle" in the year "year" # by scraping the Pubmed API. getAbstractsPmids = function(journaltitle,year){ # esearch url <- "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?" q = paste("db=pubmed&term=",gsub(" ","+",journaltitle),"[ta]+AND+",year,"[dp]&usehistory=y",sep="") esearch <- xmlTreeParse(getURL(paste(url, q, sep="")), useInternal = T) webenv <- xmlValue(getNodeSet(esearch, "//WebEnv")[[1]]) key <- xmlValue(getNodeSet(esearch, "//QueryKey")[[1]]) # efetch url <- "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?" q <- "db=pubmed&retmode=xml&rettype=abstract" efetch <- xmlTreeParse(getURL(paste(url, q, "&WebEnv=", webenv, "&query_key=", key, sep="")), useInternal = T) r = xmlRoot(efetch) n = xmlSize(r) abstracts = pmid = titles = rep(NA,n) for(i in 1:n){abstracts[i] = xmlValue(r[[i]][[1]][["Article"]][["Abstract"]]); pmid[i] = xmlValue(r[[i]][[1]][["PMID"]]); titles[i] = xmlValue(r[[i]][[1 -]][["Article"]][["ArticleTitle"]]) } return(list(abstracts=abstracts,pmid=pmid,titles=titles)) }# -#A function to remove trailing zeros from the P-value strings removeTrailing = function(string){ while(length(grep("[0-9]",strsplit(string,"")[[1]][nchar(string)])) == 0){ string = substr(string,1,(nchar(string)-1)) } return(string) }# -# A function to convert the scientific notation used by journals into # numeric values that can be analyzed. convertScientific = function(string){ if(length(grep("[[:punct:]][[:space:]]",string))>0){ string = strsplit(string,"[[:punct:]][[:space:]]")[[1]][1] string = removeTrailing(string) } if(length(grep("[×x]",string))>0){ string = gsub("[:space:]","",string) tmp1 = as.numeric(strsplit(string,"[×x]")[[1]][1]) tmp2 = as.numeric(strsplit(strsplit(string,"[×x]")[[1]][2],"[−-]")[[1]][2]) return(tmp1*10^(-tmp2)) }else{ return(as.numeric(string)) } }# -# A function to scrape the P-values from a vector of abstracts with corresponding # pubmed ids getPvalues = function(abstract,pmid){ pvalues = numeric(0) trunc = numeric(0) ids = numeric(0) # Get the truncated p-values ind = grep("[Pp][[:space:]]?[<≤]",abstract) for(i in 1:length(ind)){ tmp = strsplit(abstract[ind[i]],"[[:space:](][Pp][[:space:]]?[<≤]")[[1]] n = length(tmp) for(j in 1:n){ if(length(grep("[.0123456789]",substr(tmp[j],1,2))) > 0){ if(length(grep("[A-Z]",substr(tmp[j],1,1)))>0){next;} tmp2 = strsplit(tmp[j],"[^[:punct:][:digit:]x[:space:]]")[[1]][1] tmp2 = removeTrailing(tmp2) tmp2 = gsub(" ","",tmp2) tmp2 = convertScientific(tmp2) pvalues = c(pvalues,as.numeric(tmp2)) trunc = c(trunc,1) ids = c(ids,pmid[ind[i]]) } } } # Get the truncated p-values ind = grep("[Pp][[:space:]]?=",abstract) for(i in 1:length(ind)){ tmp = strsplit(abstract[ind[i]],"[[:space:](][Pp][[:space:]] -?=")[[1]] n = length(tmp) for(j in 1:n){ if(length(grep("[.0123456789]",substr(tmp[j],1,2))) > 0){ if(length(grep("[A-Z]",substr(tmp[j],1,1)))>0){next;} tmp2 = strsplit(tmp[j],"[^[:punct:][:space:][:digit:]x[:space:]]")[[1]][1] tmp2 = removeTrailing(tmp2) tmp2 = gsub(" ","",tmp2) tmp2 = convertScientific(tmp2) pvalues = c(pvalues,as.numeric(tmp2)) trunc = c(trunc,0) ids = c(ids,pmid[ind[i]]) } } } return(list(pvalues=pvalues,ids=ids,trunc=trunc)) }# -## Run the above functions over a specified set of journals and years ## to obtain P-values# -journals = c("JAMA","New England Journal of Medicine","BMJ","American Journal of Epidemiology","Lancet") years = 2000:2010 pvalueData = matrix(NA,nrow=1,ncol=6) colnames(pvalueData) = c("pvalue","pvalueTruncated","pubmedID","year","abstract","title") npapers = matrix(NA,nrow=length(journals),ncol=length(years)) for(i in 1:length(journals)){ for(j in 1:length(years)){ cat(journals[i]); cat(" "); cat(years[j]); cat(" "); tmpData = getAbstractsPmids(journals[i],years[j]) while(length(tmpData$abstracts) ==1 & is.na(tmpData$abstracts[1])){tmpData = getAbstractsPmids(journals[i],years[j])} cat("Downloaded"); cat(" "); npapers[i,j] = length(tmpData$abstracts) tmpOut = getPvalues(tmpData$abstracts,tmpData$pmid)# -nPvalues = length(tmpOut$pvalues) aa = match(tmpOut$ids,tmpData$pmid)# -tmpMatrix = cbind(tmpOut$pvalues,tmpOut$trunc,as.numeric(tmpOut$ids),rep(years[j],nPvalues),tmpData$abstracts[aa],tmpData$titles[aa]) rownames(tmpMatrix) = rep(journals[i],nPvalues) pvalueData = rbind(pvalueData,tmpMatrix) cat("Done\n") } }# -## These come from the paper Pubmed ID = 20876667 and are reports from ## a GWAS. Update some P-values that are incorrectly scraped because of ## variation in scientific notation. pvalueData[pvalueData[,1] == 10,1] = 10e-7 pvalueData = pvalueData[-1,] ## These come from the Lancet, with missed periods in the P-values pvalueData[13392,1] = 0.003 pvalueData[13413,1] = 0.014 pvalueData[13414,1] = 0.004 ## This one comes from the Lancet too, where an incorrect P-value is grabbed. pvalueData = pvalueData[-14674,]# -# Remove rows with P-values that are pvalueData = pvalueData[!is.na(pvalueData[,1]),] # This one for some reason replaced a period with "small middle dot" pvalueData[which(pvalueData[,3] == 11943262),1] = 1e-4 # This one has a <<< in the P-value definition pvalueData = pvalueData[-which(pvalueData[,3]=="16421237"),] # -save(pvalueData,npapers,file="pvalueData.rda") -Functions to scrape P-values from Pubmed abstracts # Date: 7-1-12 # Copyright (C) 2011 Jeffrey T. Leek (http://www.biostat.jhsph.edu/~jleek/contact.html) and Leah R. Jager # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details, see . # # # Note: These functions were written on a Mac and may have difficulties when # read on windows machines. # ######################################################################################### -library(RCurl) library(XML) library(tm)# -# A function to get all abstracts and pubmed ids for papers from the journal "journaltitle" in the year "year" # by scraping the Pubmed API. getAbstractsPmids = function(journaltitle,year){ # esearch url <- "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?" q = paste("db=pubmed&term=",gsub(" ","+",journaltitle),"[ta]+AND+",year,"[dp]&usehistory=y",sep="") esearch <- xmlTreeParse(getURL(paste(url, q, sep="")), useInternal = T) webenv <- xmlValue(getNodeSet(esearch, "//WebEnv")[[1]]) key <- xmlValue(getNodeSet(esearch, "//QueryKey")[[1]]) # efetch url <- "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?" q <- "db=pubmed&retmode=xml&rettype=abstract" efetch <- xmlTreeParse(getURL(paste(url, q, "&WebEnv=", webenv, "&query_key=", key, sep="")), useInternal = T) r = xmlRoot(efetch) n = xmlSize(r) abstracts = pmid = titles = rep(NA,n) for(i in 1:n){abstracts[i] = xmlValue(r[[i]][[1]][["Article"]][["Abstract"]]); pmid[i] = xmlValue(r[[i]][[1]][["PMID"]]); titles[i] = xmlValue(r[[i]][[1 -]][["Article"]][["ArticleTitle"]]) } return(list(abstracts=abstracts,pmid=pmid,titles=titles)) }# -#A function to remove trailing zeros from the P-value strings removeTrailing = function(string){ while(length(grep("[0-9]",strsplit(string,"")[[1]][nchar(string)])) == 0){ string = substr(string,1,(nchar(string)-1)) } return(string) }# -# A function to convert the scientific notation used by journals into # numeric values that can be analyzed. convertScientific = function(string){ if(length(grep("[[:punct:]][[:space:]]",string))>0){ string = strsplit(string,"[[:punct:]][[:space:]]")[[1]][1] string = removeTrailing(string) } if(length(grep("[×x]",string))>0){ string = gsub("[:space:]","",string) tmp1 = as.numeric(strsplit(string,"[×x]")[[1]][1]) tmp2 = as.numeric(strsplit(strsplit(string,"[×x]")[[1]][2],"[−-]")[[1]][2]) return(tmp1*10^(-tmp2)) }else{ return(as.numeric(string)) } }# -# A function to scrape the P-values from a vector of abstracts with corresponding # pubmed ids getPvalues = function(abstract,pmid){ pvalues = numeric(0) trunc = numeric(0) ids = numeric(0) # Get the truncated p-values ind = grep("[Pp][[:space:]]?[<≤]",abstract) for(i in 1:length(ind)){ tmp = strsplit(abstract[ind[i]],"[[:space:](][Pp][[:space:]]?[<≤]")[[1]] n = length(tmp) for(j in 1:n){ if(length(grep("[.0123456789]",substr(tmp[j],1,2))) > 0){ if(length(grep("[A-Z]",substr(tmp[j],1,1)))>0){next;} tmp2 = strsplit(tmp[j],"[^[:punct:][:digit:]x[:space:]]")[[1]][1] tmp2 = removeTrailing(tmp2) tmp2 = gsub(" ","",tmp2) tmp2 = convertScientific(tmp2) pvalues = c(pvalues,as.numeric(tmp2)) trunc = c(trunc,1) ids = c(ids,pmid[ind[i]]) } } } # Get the truncated p-values ind = grep("[Pp][[:space:]]?=",abstract) for(i in 1:length(ind)){ tmp = strsplit(abstract[ind[i]],"[[:space:](][Pp][[:space:]] -?=")[[1]] n = length(tmp) for(j in 1:n){ if(length(grep("[.0123456789]",substr(tmp[j],1,2))) > 0){ if(length(grep("[A-Z]",substr(tmp[j],1,1)))>0){next;} tmp2 = strsplit(tmp[j],"[^[:punct:][:space:][:digit:]x[:space:]]")[[1]][1] tmp2 = removeTrailing(tmp2) tmp2 = gsub(" ","",tmp2) tmp2 = convertScientific(tmp2) pvalues = c(pvalues,as.numeric(tmp2)) trunc = c(trunc,0) ids = c(ids,pmid[ind[i]]) } } } return(list(pvalues=pvalues,ids=ids,trunc=trunc)) }# -## Run the above functions over a specified set of journals and years ## to obtain P-values# -journals = c("JAMA","New England Journal of Medicine","BMJ","American Journal of Epidemiology","Lancet") years = 2000:2010 pvalueData = matrix(NA,nrow=1,ncol=6) colnames(pvalueData) = c("pvalue","pvalueTruncated","pubmedID","year","abstract","title") npapers = matrix(NA,nrow=length(journals),ncol=length(years)) for(i in 1:length(journals)){ for(j in 1:length(years)){ cat(journals[i]); cat(" "); cat(years[j]); cat(" "); tmpData = getAbstractsPmids(journals[i],years[j]) while(length(tmpData$abstracts) ==1 & is.na(tmpData$abstracts[1])){tmpData = getAbstractsPmids(journals[i],years[j])} cat("Downloaded"); cat(" "); npapers[i,j] = length(tmpData$abstracts) tmpOut = getPvalues(tmpData$abstracts,tmpData$pmid)# -nPvalues = length(tmpOut$pvalues) aa = match(tmpOut$ids,tmpData$pmid)# -tmpMatrix = cbind(tmpOut$pvalues,tmpOut$trunc,as.numeric(tmpOut$ids),rep(years[j],nPvalues),tmpData$abstracts[aa],tmpData$titles[aa]) rownames(tmpMatrix) = rep(journals[i],nPvalues) pvalueData = rbind(pvalueData,tmpMatrix) cat("Done\n") } }# -## These come from the paper Pubmed ID = 20876667 and are reports from ## a GWAS. Update some P-values that are incorrectly scraped because of ## variation in scientific notation. pvalueData[pvalueData[,1] == 10,1] = 10e-7 pvalueData = pvalueData[-1,] ## These come from the Lancet, with missed periods in the P-values pvalueData[13392,1] = 0.003 pvalueData[13413,1] = 0.014 pvalueData[13414,1] = 0.004 ## This one comes from the Lancet too, where an incorrect P-value is grabbed. pvalueData = pvalueData[-14674,]# -# Remove rows with P-values that are pvalueData = pvalueData[!is.na(pvalueData[,1]),] # This one for some reason replaced a period with "small middle dot" pvalueData[which(pvalueData[,3] == 11943262),1] = 1e-4 # This one has a <<< in the P-value definition pvalueData = pvalueData[-which(pvalueData[,3]=="16421237"),] # -save(pvalueData,npapers,file="pvalueData.rda") -Functions to scrape P-values from Pubmed abstracts # Date: 7-1-12 # Copyright (C) 2011 Jeffrey T. Leek (http://www.biostat.jhsph.edu/~jleek/contact.html) and Leah R. Jager # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details, see . # # # Note: These functions were written on a Mac and may have difficulties when # read on windows machines. # ######################################################################################### -library(RCurl) library(XML) library(tm)# -# A function to get all abstracts and pubmed ids for papers from the journal "journaltitle" in the year "year" # by scraping the Pubmed API. getAbstractsPmids = function(journaltitle,year){ # esearch url <- "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?" q = paste("db=pubmed&term=",gsub(" ","+",journaltitle),"[ta]+AND+",year,"[dp]&usehistory=y",sep="") esearch <- xmlTreeParse(getURL(paste(url, q, sep="")), useInternal = T) webenv <- xmlValue(getNodeSet(esearch, "//WebEnv")[[1]]) key <- xmlValue(getNodeSet(esearch, "//QueryKey")[[1]]) # efetch url <- "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?" q <- "db=pubmed&retmode=xml&rettype=abstract" efetch <- xmlTreeParse(getURL(paste(url, q, "&WebEnv=", webenv, "&query_key=", key, sep="")), useInternal = T) r = xmlRoot(efetch) n = xmlSize(r) abstracts = pmid = titles = rep(NA,n) for(i in 1:n){abstracts[i] = xmlValue(r[[i]][[1]][["Article"]][["Abstract"]]); pmid[i] = xmlValue(r[[i]][[1]][["PMID"]]); titles[i] = xmlValue(r[[i]][[1 -]][["Article"]][["ArticleTitle"]]) } return(list(abstracts=abstracts,pmid=pmid,titles=titles)) }# -#A function to remove trailing zeros from the P-value strings removeTrailing = function(string){ while(length(grep("[0-9]",strsplit(string,"")[[1]][nchar(string)])) == 0){ string = substr(string,1,(nchar(string)-1)) } return(string) }# -# A function to convert the scientific notation used by journals into # numeric values that can be analyzed. convertScientific = function(string){ if(length(grep("[[:punct:]][[:space:]]",string))>0){ string = strsplit(string,"[[:punct:]][[:space:]]")[[1]][1] string = removeTrailing(string) } if(length(grep("[×x]",string))>0){ string = gsub("[:space:]","",string) tmp1 = as.numeric(strsplit(string,"[×x]")[[1]][1]) tmp2 = as.numeric(strsplit(strsplit(string,"[×x]")[[1]][2],"[−-]")[[1]][2]) return(tmp1*10^(-tmp2)) }else{ return(as.numeric(string)) } }# -# A function to scrape the P-values from a vector of abstracts with corresponding # pubmed ids getPvalues = function(abstract,pmid){ pvalues = numeric(0) trunc = numeric(0) ids = numeric(0) # Get the truncated p-values ind = grep("[Pp][[:space:]]?[<≤]",abstract) for(i in 1:length(ind)){ tmp = strsplit(abstract[ind[i]],"[[:space:](][Pp][[:space:]]?[<≤]")[[1]] n = length(tmp) for(j in 1:n){ if(length(grep("[.0123456789]",substr(tmp[j],1,2))) > 0){ if(length(grep("[A-Z]",substr(tmp[j],1,1)))>0){next;} tmp2 = strsplit(tmp[j],"[^[:punct:][:digit:]x[:space:]]")[[1]][1] tmp2 = removeTrailing(tmp2) tmp2 = gsub(" ","",tmp2) tmp2 = convertScientific(tmp2) pvalues = c(pvalues,as.numeric(tmp2)) trunc = c(trunc,1) ids = c(ids,pmid[ind[i]]) } } } # Get the truncated p-values ind = grep("[Pp][[:space:]]?=",abstract) for(i in 1:length(ind)){ tmp = strsplit(abstract[ind[i]],"[[:space:](][Pp][[:space:]] -?=")[[1]] n = length(tmp) for(j in 1:n){ if(length(grep("[.0123456789]",substr(tmp[j],1,2))) > 0){ if(length(grep("[A-Z]",substr(tmp[j],1,1)))>0){next;} tmp2 = strsplit(tmp[j],"[^[:punct:][:space:][:digit:]x[:space:]]")[[1]][1] tmp2 = removeTrailing(tmp2) tmp2 = gsub(" ","",tmp2) tmp2 = convertScientific(tmp2) pvalues = c(pvalues,as.numeric(tmp2)) trunc = c(trunc,0) ids = c(ids,pmid[ind[i]]) } } } return(list(pvalues=pvalues,ids=ids,trunc=trunc)) }# -## Run the above functions over a specified set of journals and years ## to obtain P-values# -journals = c("JAMA","New England Journal of Medicine","BMJ","American Journal of Epidemiology","Lancet") years = 2000:2010 pvalueData = matrix(NA,nrow=1,ncol=6) colnames(pvalueData) = c("pvalue","pvalueTruncated","pubmedID","year","abstract","title") npapers = matrix(NA,nrow=length(journals),ncol=length(years)) for(i in 1:length(journals)){ for(j in 1:length(years)){ cat(journals[i]); cat(" "); cat(years[j]); cat(" "); tmpData = getAbstractsPmids(journals[i],years[j]) while(length(tmpData$abstracts) ==1 & is.na(tmpData$abstracts[1])){tmpData = getAbstractsPmids(journals[i],years[j])} cat("Downloaded"); cat(" "); npapers[i,j] = length(tmpData$abstracts) tmpOut = getPvalues(tmpData$abstracts,tmpData$pmid)# -nPvalues = length(tmpOut$pvalues) aa = match(tmpOut$ids,tmpData$pmid)# -tmpMatrix = cbind(tmpOut$pvalues,tmpOut$trunc,as.numeric(tmpOut$ids),rep(years[j],nPvalues),tmpData$abstracts[aa],tmpData$titles[aa]) rownames(tmpMatrix) = rep(journals[i],nPvalues) pvalueData = rbind(pvalueData,tmpMatrix) cat("Done\n") } } -Functions to scrape P-values from Pubmed abstracts # Date: 7-1-12 # Copyright (C) 2011 Jeffrey T. Leek (http://www.biostat.jhsph.edu/~jleek/contact.html) and Leah R. Jager # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details, see . # # # Note: These functions were written on a Mac and may have difficulties when # read on windows machines. # ######################################################################################### -library(RCurl) library(XML) library(tm)# -# A function to get all abstracts and pubmed ids for papers from the journal "journaltitle" in the year "year" # by scraping the Pubmed API. getAbstractsPmids = function(journaltitle,year){ # esearch url <- "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?" q = paste("db=pubmed&term=",gsub(" ","+",journaltitle),"[ta]+AND+",year,"[dp]&usehistory=y",sep="") esearch <- xmlTreeParse(getURL(paste(url, q, sep="")), useInternal = T) webenv <- xmlValue(getNodeSet(esearch, "//WebEnv")[[1]]) key <- xmlValue(getNodeSet(esearch, "//QueryKey")[[1]]) # efetch url <- "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?" q <- "db=pubmed&retmode=xml&rettype=abstract" efetch <- xmlTreeParse(getURL(paste(url, q, "&WebEnv=", webenv, "&query_key=", key, sep="")), useInternal = T) r = xmlRoot(efetch) n = xmlSize(r) abstracts = pmid = titles = rep(NA,n) for(i in 1:n){abstracts[i] = xmlValue(r[[i]][[1]][["Article"]][["Abstract"]]); pmid[i] = xmlValue(r[[i]][[1]][["PMID"]]); titles[i] = xmlValue(r[[i]][[1]][["Article"]][["ArticleTitle"]]) } return(list(abstracts=abstracts,pmid=pmid,titles=titles)) }# -#A function to remove trailing zeros from the P-value strings removeTrailing = function(string){ while(length(grep("[0-9]",strsplit(string,"")[[1]][nchar(string)])) == 0){ string = substr(string,1,(nchar(string)-1)) } return(string) }# -# A function to convert the scientific notation used by journals into # numeric values that can be analyzed. convertScientific = function(string){ if(length(grep("[[:punct:]][[:space:]]",string))>0){ string = strsplit(string,"[[:punct:]][[:space:]]")[[1]][1] string = removeTrailing(string) } if(length(grep("[×x]",string))>0){ string = gsub("[:space:]","",string) tmp1 = as.numeric(strsplit(string,"[×x]")[[1]][1]) tmp2 = as.numeric(strsplit(strsplit(string,"[×x]")[[1]][2],"[−-]")[[1]][2]) return(tmp1*10^(-tmp2)) }else{ return(as.numeric(string)) } }# -# A function to scrape the P-values from a vector of abstracts with corresponding # pubmed ids getPvalues = function(abstract,pmid){ pvalues = numeric(0) trunc = numeric(0) ids = numeric(0) # Get the truncated p-values ind = grep("[Pp][[:space:]]?[<≤]",abstract) for(i in 1:length(ind)){ tmp = strsplit(abstract[ind[i]],"[[:space:](][Pp][[:space:]]?[<≤]")[[1]] n = length(tmp) for(j in 1:n){ if(length(grep("[.0123456789]",substr(tmp[j],1,2))) > 0){ if(length(grep("[A-Z]",substr(tmp[j],1,1)))>0){next;} tmp2 = strsplit(tmp[j],"[^[:punct:][:digit:]x[:space:]]")[[1]][1] tmp2 = removeTrailing(tmp2) tmp2 = gsub(" ","",tmp2) tmp2 = convertScientific(tmp2) pvalues = c(pvalues,as.numeric(tmp2)) trunc = c(trunc,1) ids = c(ids,pmid[ind[i]]) } } } # Get the truncated p-values ind = grep("[Pp][[:space:]]?=",abstract) for(i in 1:length(ind)){ tmp = strsplit(abstract[ind[i]],"[[:space:](][Pp][[:space:]]?=")[[1]] n = length(tmp) for(j in 1:n){ if(length(grep("[.0123456789]",substr(tmp[j],1,2))) > 0){ if(length(grep("[A-Z]",substr(tmp[j],1,1)))>0){next;} tmp2 = strsplit(tmp[j],"[^[:punct:][:space:][:digit:]x[:space:]]")[[1]][1] tmp2 = removeTrailing(tmp2) tmp2 = gsub(" ","",tmp2) tmp2 = convertScientific(tmp2) pvalues = c(pvalues,as.numeric(tmp2)) trunc = c(trunc,0) ids = c(ids,pmid[ind[i]]) } } } return(list(pvalues=pvalues,ids=ids,trunc=trunc)) } -journals = c("JAMA","New England Journal of Medicine","BMJ","American Journal of Epidemiology","Lancet") years = 2000:2010 pvalueData = matrix(NA,nrow=1,ncol=6) colnames(pvalueData) = c("pvalue","pvalueTruncated","pubmedID","year","abstract","title") npapers = matrix(NA,nrow=length(journals),ncol=length(years)) for(i in 1:length(journals)){ for(j in 1:length(years)){ cat(journals[i]); cat(" "); cat(years[j]); cat(" "); tmpData = getAbstractsPmids(journals[i],years[j]) while(length(tmpData$abstracts) ==1 & is.na(tmpData$abstracts[1])){tmpData = getAbstractsPmids(journals[i],years[j])} cat("Downloaded"); cat(" "); npapers[i,j] = length(tmpData$abstracts) tmpOut = getPvalues(tmpData$abstracts,tmpData$pmid)# -nPvalues = length(tmpOut$pvalues) aa = match(tmpOut$ids,tmpData$pmid)# -tmpMatrix = cbind(tmpOut$pvalues,tmpOut$trunc,as.numeric(tmpOut$ids),rep(years[j],nPvalues),tmpData$abstracts[aa],tmpData$titles[aa]) rownames(tmpMatrix) = rep(journals[i],nPvalues) pvalueData = rbind(pvalueData,tmpMatrix) cat("Done\n") } } -tmpData -i -j -tmpData = getAbstractsPmids(journals[i],years[j]) -while(length(tmpData$abstracts) ==1 & is.na(tmpData$abstracts[1])){tmpData = getAbstractsPmids(journals[i],years[j])} cat("Downloaded"); cat(" "); npapers[i,j] = length(tmpData$abstracts) tmpOut = getPvalues(tmpData$abstracts,tmpData$pmid)# -nPvalues = length(tmpOut$pvalues) aa = match(tmpOut$ids,tmpData$pmid)# -tmpMatrix = cbind(tmpOut$pvalues,tmpOut$trunc,as.numeric(tmpOut$ids),rep(years[j],nPvalues),tmpData$abstracts[aa],tmpData$titles[aa]) rownames(tmpMatrix) = rep(journals[i],nPvalues) pvalueData = rbind(pvalueData,tmpMatrix) cat("Done\n") -journals = c("JAMA","New England Journal of Medicine","BMJ","American Journal of Epidemiology","Lancet") years = 2000:2010 pvalueData = matrix(NA,nrow=1,ncol=6) colnames(pvalueData) = c("pvalue","pvalueTruncated","pubmedID","year","abstract","title") npapers = matrix(NA,nrow=length(journals),ncol=length(years)) for(i in 1:length(journals)){ for(j in 1:length(years)){ cat(journals[i]); cat(" "); cat(years[j]); cat(" "); tmpData = getAbstractsPmids(journals[i],years[j]) while(length(tmpData$abstracts) ==1 & is.na(tmpData$abstracts[1])){tmpData = getAbstractsPmids(journals[i],years[j])} cat("Downloaded"); cat(" "); npapers[i,j] = length(tmpData$abstracts) tmpOut = getPvalues(tmpData$abstracts,tmpData$pmid)# -nPvalues = length(tmpOut$pvalues) aa = match(tmpOut$ids,tmpData$pmid)# -tmpMatrix = cbind(tmpOut$pvalues,tmpOut$trunc,as.numeric(tmpOut$ids),rep(years[j],nPvalues),tmpData$abstracts[aa],tmpData$titles[aa]) rownames(tmpMatrix) = rep(journals[i],nPvalues) pvalueData = rbind(pvalueData,tmpMatrix) cat("Done\n") } } -barplot(c(1,1,-3)) -?barplot -pres12 = read.csv("~/Desktop/2012-pres.csv") -pres12[1,] -pres08 = read.csv("~/Desktop/2008pres.csv") -pres08[1,] -sum(pres12$FIPS == 0) -table(pres12$X[pres12$FIPS==0,]) -table(pres12$X[pres12$FIPS==0]) -pres12[pres12$X=="OK",] -pres12 = pres12[pres12$FIPS==0,] -dim(pres12) -pres12[1,] -pres12[2,] -pres12 = read.csv("~/Desktop/2012-pres.csv") -pres12[1:10,] -pres12[21:30,] -pres12[50:100,] -pres12 = pres12[pres12$FIPS==0,] -length(unique(pres12$X)) -which.max(pres12$X == "OK") -which(pres12$X == "OK") -pres12[c(36,37)] -pres12[c(36,37),] -pres12[1,] -pres12[1,5] -pres12[1,4] -as.numeric(pres12[1,4]) -as.numeric(as.character(pres12[1,4]) -) -as.numeric(as.character(pres12[1,4])) -pres08[1,] -sum(pres08$LAST.NAME == "McCain") -sum(pres08$LAST.NAME == "McCain" & pres08$STATE=="Alabama") -pres08[pres08$LAST.NAME == "McCain",] -pres12 = read.csv("~/Desktop/2012-pres.csv") -pres12 = pres12[pres12$FIPS==0,] -pres12[1,] -table(unique(pres12)) -table(unique(pres12$x)) -table(unique(pres12$X)) -substr -gsub -gsub(pres12[1,3]) -pres12[1,] -pres12$Obama.vote[1] -dem12 = as.character(pres12$Obama.vote) -dem12[1] -dem12 = sapply(dem12,function(x){gsub(x,",","")}) -dem12[1] -dem12 = as.character(pres12$Obama.vote) -gsub(dem12[1],",","") -?gsub -gsub(",","",dem12[1]) -dem12 = as.character(pres12$Obama.vote) -dem12 = as.numeric(sapply(dem12,function(x){gsub(",","",x)})) -dem12[1] -hist(dem12) -pres12 = read.csv("~/Desktop/2012-pres.csv") -pres12 = pres12[pres12$FIPS==0,] -dem12 = as.character(pres12$Obama.vote) -dem12 = as.numeric(sapply(dem12,function(x){gsub(",","",x)})) -rep12 = as.character(pres12$Romney.vote) -rep12 = as.numeric(sapply(rep12,function(x){gsub(",","",x)})) -plot(rep12,dem12) -rep12[1] -pres12[1,] -table(pres12[,2]) -res12 = read.csv("~/Desktop/2012-pres.csv") -pres12 = pres12[pres12$FIPS==0,] -table(pres12[,2]) -table(pres12[,1]) -library(XML) -theurl <- "http://uselectionatlas.org/RESULTS/data.php?year=2008&datatype=national&def=1&f=0&off=0&elect=0" -tables <- readHTMLTable(theurl) -tables[1,] -dim(tables) -tables[1] -tables -n.rows <- unlist(lapply(tables, function(t) dim(t)[1])) -n.rows -library(slidify) -?author -setwd("~/Documents/Work/teaching/2013/coursera/") -ls() -list.files() -author("gettingStarted") -slidify("gettingStarted") -ls() -list.files() -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -setwd("~/Documents/Work/teaching/2013/coursera/") -setwd("week1/gettingHelp/") -slidify("index.Rmd") -library(slidify) -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") diff --git a/006simulationBasics/.Rhistory b/006simulationBasics/.Rhistory deleted file mode 100644 index 7955cdc..0000000 --- a/006simulationBasics/.Rhistory +++ /dev/null @@ -1,437 +0,0 @@ -text(5.5,5.5,teamName1,col ="red", family = 'Helvetica', cex = cx/1.5) -}else{ -text(5.5,5.5,teamName2,col ="blue", family = 'Helvetica', cex = cx/1.5) -} -plot(1:10,1:10,type="n",xaxt="n",yaxt="n",main=paste(teamName1,"Accuracy")) -text(5.5,5.5,paste(cumMean(trueLabels[1:i] == team1Pred[1:i]),"%"),col ="red", family = 'Helvetica', cex = cx/1.5) -plot(1:10,1:10,type="n",xaxt="n",yaxt="n",main=paste(teamName2,"Accuracy")) -text(5.5,5.5,paste(cumMean(trueLabels[1:i] == team2Pred[1:i]),"%"),col ="blue", family = 'Helvetica', cex = cx/1.5) -} -makeVideo(teamName1="JoelDan",teamName2="SarahMax", -trueLabels=battleData[battleSample,1],team1Pred=nonPCA[battleSample,"JoelDan"], -team2Pred=nonPCA[battleSample,"SarahMax"],testImages=as.matrix(battleData[battleSample,-1])) -makeVideo(teamName1="GregColin",teamName2="SarahMax", -trueLabels=battleData[battleSample,1],team1Pred=nonPCA[battleSample,"GregColin"], -team2Pred=nonPCA[battleSample,"SarahMax"],testImages=as.matrix(battleData[battleSample,-1])) -makeVideo(teamName1="GregColin",teamName2="JoelDan", -trueLabels=battleData[battleSample,1],team1Pred=nonPCA[battleSample,"GregColin"], -team2Pred=nonPCA[battleSample,"JoelDan"],testImages=as.matrix(battleData[battleSample,-1])) -names(PCA) -battleSample = sample(1:3000,size=100,replace=FALSE) -makeVideo(teamName1="GregColinPCA",teamName2="JonPhoebe", -trueLabels=battleData[battleSample,1],team1Pred=PCA[battleSample,"GregColinPCA"], -team2Pred=PCA[battleSample,"JonPhoebe"],testImages=as.matrix(battleData[battleSample,-1])) -head(PCA) -names(PCA) -battleSample = sample(1:3000,size=100,replace=FALSE) -makeVideo(teamName1="WesJoeEm",teamName2="CalebChey", -trueLabels=battleData[battleSample,1],team1Pred=PCA[battleSample,"WesJoeEm"], -team2Pred=PCA[battleSample,"CalebChey"],testImages=as.matrix(battleData[battleSample,-1])) -battleSample = sample(1:3000,size=100,replace=FALSE) -makeVideo(teamName1="JonPhoebe",teamName2="GregColin", -trueLabels=battleData[battleSample,1],team1Pred=PCA[battleSample,"JonPhoebe"], -team2Pred=nonPCA[battleSample,"GregColin"],testImages=as.matrix(battleData[battleSample,-1])) -displayTeams <- function(teamName1="The Jets",teamName2="The Sharks",cx=5,nFrames=10){ -par(mar=c(0,0,4,0),bg="black",col.main="white") -layout(matrix(c(1,1,1,2,2,2),byrow=T,nrow=2)) -colRampWhite = colorRampPalette(c("black","white"))(nFrames) -colRampRed= colorRampPalette(c("black","red"))(nFrames) -colRampBlue= colorRampPalette(c("black","blue"))(nFrames) -for(i in 1:nFrames){ -Team1 -plot(1:10,1:10,type="n") -text(5.5,5.5,teamName1,col = colRampRed[i], family = 'Helvetica', cex = cx) -Team2 -plot(1:10,1:10,type="n",main="Versus",cex.main=3) -text(5.5,5.5,teamName2,col = colRampBlue[i], family = 'Helvetica', cex = cx) -Sys.sleep(2/nFrames) -} -predictionMatch <- function(teamName1,teamName2,trueLabels,testImages,team1Pred,team2Pred,cx=8){ -par(mar=c(0,0,4,0),bg="black",col.main="white") -layout(matrix(c(2,1,4,3,0,5),byrow=T,nrow=2)) -for(i in 1:dim(testImages)[1]){ -zz = matrix(testImages[i,],nrow=28) -image(zz[,ncol(zz):1],main="True Image",xaxt="n",yaxt="n",col=colRampWhite,cex.main=3) -Sys.sleep(0.2) -plot(1:10,1:10,type="n",xaxt="n",yaxt="n",main=paste(teamName1),cex.main=3) -text(5.5,5.5,team1Pred[i],col ="red", family = 'Helvetica', cex = cx) -plot(1:10,1:10,type="n",xaxt="n",yaxt="n",main=paste("Accuracy"),cex.main=3) -text(5.5,5.5,paste(cumMean(trueLabels[1:i] == team1Pred[1:i]),"%"),col ="red", family = 'Helvetica', cex = cx/1.5) -Sys.sleep(0.2) -plot(1:10,1:10,type="n",xaxt="n",yaxt="n",main=paste(teamName2),cex.main=3) -text(5.5,5.5,team2Pred[i],col ="blue", family = 'Helvetica', cex = cx) -plot(1:10,1:10,type="n",xaxt="n",yaxt="n",main=paste("Accuracy"),cex.main=3) -text(5.5,5.5,paste(cumMean(trueLabels[1:i] == team2Pred[1:i]),"%"),col ="blue", family = 'Helvetica', cex = cx/1.5) -Sys.sleep(0.4) -} -par(mar=c(0,0,4,0),bg="black",col.main="white") -layout(matrix(c(1,1,1,2,0,3),byrow=T,nrow=2)) -plot(1:10,1:10,type="n",xaxt="n",yaxt="n",main="Winner",cex.main=3) -team1winner = cumMean(trueLabels ==team1Pred) > cumMean(trueLabels==team2Pred) -if(team1winner){ -text(5.5,5.5,teamName1,col ="red", family = 'Helvetica', cex = cx/1.5) -}else{ -text(5.5,5.5,teamName2,col ="blue", family = 'Helvetica', cex = cx/1.5) -} -plot(1:10,1:10,type="n",xaxt="n",yaxt="n",main=paste(teamName1),cex.main=3) -text(5.5,5.5,paste(cumMean(trueLabels[1:i] == team1Pred[1:i]),"%"),col ="red", family = 'Helvetica', cex = cx/1.5) -plot(1:10,1:10,type="n",xaxt="n",yaxt="n",main=paste(teamName2),cex.main=3) -text(5.5,5.5,paste(cumMean(trueLabels[1:i] == team2Pred[1:i]),"%"),col ="blue", family = 'Helvetica', cex = cx/1.5) -} -cumMean = function(x){ -return(round(mean(x)*100,1)) -} -makeVideo <- function(teamName1,teamName2,trueLabels,team1Pred,team2Pred,testImages){ -displayTeams(teamName1=teamName1,teamName2=teamName2) -predictionMatch(teamName1=teamName1,teamName2=teamName2, -trueLabels=trueLabels,team1Pred=team1Pred, -team2Pred=team2Pred,testImages=testImages) -} -nonPCA = read.csv("~/Dropbox/Leah/Teaching/SM439/SM439/Project2/nonPCAbattle.csv",header=T) -PCA = read.csv("~/Dropbox/Leah/Teaching/SM439/SM439/Project2/PCAbattle.csv",header=T) -battleData= read.csv("~/Dropbox/Leah/Teaching/SM439/SM439/Project2/battleData.csv",header=T) -battleSample = sample(1:3000,size=5,replace=FALSE) -makeVideo(teamName1="JoelDan",teamName2="SarahMax", -trueLabels=battleData[battleSample,1],team1Pred=nonPCA[battleSample,"JoelDan"], -team2Pred=nonPCA[battleSample,"SarahMax"],testImages=as.matrix(battleData[battleSample,-1])) -battleSample = sample(1:3000,size=100,replace=FALSE) -makeVideo(teamName1="JoelDan",teamName2="SarahMax", -trueLabels=battleData[battleSample,1],team1Pred=nonPCA[battleSample,"JoelDan"], -team2Pred=nonPCA[battleSample,"SarahMax"],testImages=as.matrix(battleData[battleSample,-1])) -windowsFonts() -?par -library(RCurl) library(XML) library(tm)# -# A function to get all abstracts and pubmed ids for papers from the journal "journaltitle" in the year "year" # by scraping the Pubmed API. getAbstractsPmids = function(journaltitle,year){ # esearch url <- "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?" q = paste("db=pubmed&term=",gsub(" ","+",journaltitle),"[ta]+AND+",year,"[dp]&usehistory=y",sep="") esearch <- xmlTreeParse(getURL(paste(url, q, sep="")), useInternal = T) webenv <- xmlValue(getNodeSet(esearch, "//WebEnv")[[1]]) key <- xmlValue(getNodeSet(esearch, "//QueryKey")[[1]]) # efetch url <- "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?" q <- "db=pubmed&retmode=xml&rettype=abstract" efetch <- xmlTreeParse(getURL(paste(url, q, "&WebEnv=", webenv, "&query_key=", key, sep="")), useInternal = T) r = xmlRoot(efetch) n = xmlSize(r) abstracts = pmid = titles = rep(NA,n) for(i in 1:n){abstracts[i] = xmlValue(r[[i]][[1]][["Article"]][["Abstract"]]); pmid[i] = xmlValue(r[[i]][[1]][["PMID"]]); titles[i] = xmlValue(r[[i]][[1 -]][["Article"]][["ArticleTitle"]]) } return(list(abstracts=abstracts,pmid=pmid,titles=titles)) }# -#A function to remove trailing zeros from the P-value strings removeTrailing = function(string){ while(length(grep("[0-9]",strsplit(string,"")[[1]][nchar(string)])) == 0){ string = substr(string,1,(nchar(string)-1)) } return(string) }# -# A function to convert the scientific notation used by journals into # numeric values that can be analyzed. convertScientific = function(string){ if(length(grep("[[:punct:]][[:space:]]",string))>0){ string = strsplit(string,"[[:punct:]][[:space:]]")[[1]][1] string = removeTrailing(string) } if(length(grep("[×x]",string))>0){ string = gsub("[:space:]","",string) tmp1 = as.numeric(strsplit(string,"[×x]")[[1]][1]) tmp2 = as.numeric(strsplit(strsplit(string,"[×x]")[[1]][2],"[−-]")[[1]][2]) return(tmp1*10^(-tmp2)) }else{ return(as.numeric(string)) } }# -# A function to scrape the P-values from a vector of abstracts with corresponding # pubmed ids getPvalues = function(abstract,pmid){ pvalues = numeric(0) trunc = numeric(0) ids = numeric(0) # Get the truncated p-values ind = grep("[Pp][[:space:]]?[<≤]",abstract) for(i in 1:length(ind)){ tmp = strsplit(abstract[ind[i]],"[[:space:](][Pp][[:space:]]?[<≤]")[[1]] n = length(tmp) for(j in 1:n){ if(length(grep("[.0123456789]",substr(tmp[j],1,2))) > 0){ if(length(grep("[A-Z]",substr(tmp[j],1,1)))>0){next;} tmp2 = strsplit(tmp[j],"[^[:punct:][:digit:]x[:space:]]")[[1]][1] tmp2 = removeTrailing(tmp2) tmp2 = gsub(" ","",tmp2) tmp2 = convertScientific(tmp2) pvalues = c(pvalues,as.numeric(tmp2)) trunc = c(trunc,1) ids = c(ids,pmid[ind[i]]) } } } # Get the truncated p-values ind = grep("[Pp][[:space:]]?=",abstract) for(i in 1:length(ind)){ tmp = strsplit(abstract[ind[i]],"[[:space:](][Pp][[:space:]] -?=")[[1]] n = length(tmp) for(j in 1:n){ if(length(grep("[.0123456789]",substr(tmp[j],1,2))) > 0){ if(length(grep("[A-Z]",substr(tmp[j],1,1)))>0){next;} tmp2 = strsplit(tmp[j],"[^[:punct:][:space:][:digit:]x[:space:]]")[[1]][1] tmp2 = removeTrailing(tmp2) tmp2 = gsub(" ","",tmp2) tmp2 = convertScientific(tmp2) pvalues = c(pvalues,as.numeric(tmp2)) trunc = c(trunc,0) ids = c(ids,pmid[ind[i]]) } } } return(list(pvalues=pvalues,ids=ids,trunc=trunc)) }# -## Run the above functions over a specified set of journals and years ## to obtain P-values# -journals = c("JAMA","New England Journal of Medicine","BMJ","American Journal of Epidemiology","Lancet") years = 2000:2010 pvalueData = matrix(NA,nrow=1,ncol=6) colnames(pvalueData) = c("pvalue","pvalueTruncated","pubmedID","year","abstract","title") npapers = matrix(NA,nrow=length(journals),ncol=length(years)) for(i in 1:length(journals)){ for(j in 1:length(years)){ cat(journals[i]); cat(" "); cat(years[j]); cat(" "); tmpData = getAbstractsPmids(journals[i],years[j]) while(length(tmpData$abstracts) ==1 & is.na(tmpData$abstracts[1])){tmpData = getAbstractsPmids(journals[i],years[j])} cat("Downloaded"); cat(" "); npapers[i,j] = length(tmpData$abstracts) tmpOut = getPvalues(tmpData$abstracts,tmpData$pmid)# -nPvalues = length(tmpOut$pvalues) aa = match(tmpOut$ids,tmpData$pmid)# -tmpMatrix = cbind(tmpOut$pvalues,tmpOut$trunc,as.numeric(tmpOut$ids),rep(years[j],nPvalues),tmpData$abstracts[aa],tmpData$titles[aa]) rownames(tmpMatrix) = rep(journals[i],nPvalues) pvalueData = rbind(pvalueData,tmpMatrix) cat("Done\n") } }# -## These come from the paper Pubmed ID = 20876667 and are reports from ## a GWAS. Update some P-values that are incorrectly scraped because of ## variation in scientific notation. pvalueData[pvalueData[,1] == 10,1] = 10e-7 pvalueData = pvalueData[-1,] ## These come from the Lancet, with missed periods in the P-values pvalueData[13392,1] = 0.003 pvalueData[13413,1] = 0.014 pvalueData[13414,1] = 0.004 ## This one comes from the Lancet too, where an incorrect P-value is grabbed. pvalueData = pvalueData[-14674,]# -# Remove rows with P-values that are pvalueData = pvalueData[!is.na(pvalueData[,1]),] # This one for some reason replaced a period with "small middle dot" pvalueData[which(pvalueData[,3] == 11943262),1] = 1e-4 -dim(pvalueDAta) -dim(pvalueData) -pvalueData2 = pvalueData -load("~/Downloads/pvalueData00-10.rda") -ls() -dim(pvalueData) -pvalueData[1,] -pvalueData2[1,] -names(pvalueDAta) -names(pvalueData) -names(pvalueData2) -dim(pvalueData) -dim(pvalueData2) -pvalueData2[1,] -pvalueData2[2,] -pvalueData2[1,] -pvalueData[1,] -oo = match(pvalueData$pubmedID,pvalueData2$pubmedID) -colnames(pvalueData) -colnames(pvalueData2) -oo = match(pvalueData[,3],pvalueData2[,3]) -length(oo) -oo[1] -sum(is.na(oo)) -tmp1 = pvalueData[,3] -tmp2 = pvalueData2[,3] -tmp1[1] -tmp2[1] -tmp2 = as.numeric(tmp2) -tmp1 = tmp1[order(tmp1)] -tmp2 = tmp2[order(tmp2)] -tmp1[1] -tmp2[1] -length(tmp1) -length(tmp2) -sum(tmp1[1:15653] == tmp2[1:15653]) -tmp1[13427:13428] -tmp1[13427:13429] -tmp2[13427:13429] -tmp1[13425:13429] -tmp2[13425:13429] -pvalueData[1,] -pvalueData[pvalueData[,3]==19549972, ] -pvalueData2[pvalueData2[,3]=="19549972", ] -pvalueData2[pvalueData2[,3]=="19549973", ] -tmp2[13425:13429] -tmp2[13424:13429] -tmp1[13424:13429] -sum(tmp1[1:13424] == tmp2[1:13424]) -sum(tmp1[1:11940] == tmp2[1:11940]) -plot(tmp1,tmp2) -length(tmp2) -plot(tmp1,tmp2[1:15653]) -t1 = table(tmp1) -t2 = table(tmp2) -t1[1] -t2[1] -sum(t1 == t2) -length(t2) -length(t1) -setdiff(names(t1),names(t2)) -sum(t1 == t2[1:5323]) -oo = match(names(t1),names(t2)) -length(oo) -oo[1] -oo = match(names(t2),names(t1)) -length(oo) -sum(is.na(oo)) -which(is.na(oo)) -length(names(t2)) -t2[3097] -sum(t2) -dim(pvalueData) -dim(pvalueData2) -pvalueData2[pvalueData2[,3]=="16421237",] -pvalueData3 = pvalueData2[-which(pvalueData2[,3]=="16421237"),] -dim(pvalueData3) -dim(pvalueData) -tmp1 = pvalueData3[,3] -tmp2 = pvalueData[,3] -length(tmp1) -length(tmp2) -tmp1[1] -tmp2[1] -tmp1 = as.numeric(tmp1) -tmp1 = tmp1[order(tmp1)] -tmp2 = tmp2[order(tmp2)] -tmp1[1] -tmp2[1] -plot(tmp1,tmp2) -sum(tmp1==tmp2) -mean(tmp1==tmp2) -tmp1 = pvalueData3[,3]# -tmp2 = pvalueData[,3] -tmp1[1] -tmp1 = as.numeric(tmp1) -colnames(pvalueData3) -pvals1 = as.numeric(pvalueData3[,1]) -pvals2 = as.numeric(pvalueData[,1]) -pvals1[1] -pvals2[1] -pvals1 = pvals1[order(tmp1)] -pvals2 = pvals1[order(tmp2)] -sum(pvals1==pvals2) -length(pvals1) -ne = which(pvals1!=pvals2) -ne[1] -pvals1 = as.numeric(pvalueData3[,1]) -pvals2 = as.numeric(pvalueData[,1]) -pvals1 = pvals1[order(tmp1)] -pvals2 = pvals2[order(tmp2)] -sum(pvals1==pvals2) -length(pvals1) -mean(pvals1==pvals2) -mean((pvals1 - pvals2) < 1e-3) -mean((pvals1 - pvals2) < 1e-5) -mean(abs(pvals1 - pvals2) < 1e-5 ) -dim(pvalueData) -dim(pvalueData3) -rm(list=ls()) -Functions to scrape P-values from Pubmed abstracts # Date: 7-1-12 # Copyright (C) 2011 Jeffrey T. Leek (http://www.biostat.jhsph.edu/~jleek/contact.html) and Leah R. Jager # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details, see . # # # Note: These functions were written on a Mac and may have difficulties when # read on windows machines. # ######################################################################################### -library(RCurl) library(XML) library(tm)# -# A function to get all abstracts and pubmed ids for papers from the journal "journaltitle" in the year "year" # by scraping the Pubmed API. getAbstractsPmids = function(journaltitle,year){ # esearch url <- "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?" q = paste("db=pubmed&term=",gsub(" ","+",journaltitle),"[ta]+AND+",year,"[dp]&usehistory=y",sep="") esearch <- xmlTreeParse(getURL(paste(url, q, sep="")), useInternal = T) webenv <- xmlValue(getNodeSet(esearch, "//WebEnv")[[1]]) key <- xmlValue(getNodeSet(esearch, "//QueryKey")[[1]]) # efetch url <- "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?" q <- "db=pubmed&retmode=xml&rettype=abstract" efetch <- xmlTreeParse(getURL(paste(url, q, "&WebEnv=", webenv, "&query_key=", key, sep="")), useInternal = T) r = xmlRoot(efetch) n = xmlSize(r) abstracts = pmid = titles = rep(NA,n) for(i in 1:n){abstracts[i] = xmlValue(r[[i]][[1]][["Article"]][["Abstract"]]); pmid[i] = xmlValue(r[[i]][[1]][["PMID"]]); titles[i] = xmlValue(r[[i]][[1 -]][["Article"]][["ArticleTitle"]]) } return(list(abstracts=abstracts,pmid=pmid,titles=titles)) }# -#A function to remove trailing zeros from the P-value strings removeTrailing = function(string){ while(length(grep("[0-9]",strsplit(string,"")[[1]][nchar(string)])) == 0){ string = substr(string,1,(nchar(string)-1)) } return(string) }# -# A function to convert the scientific notation used by journals into # numeric values that can be analyzed. convertScientific = function(string){ if(length(grep("[[:punct:]][[:space:]]",string))>0){ string = strsplit(string,"[[:punct:]][[:space:]]")[[1]][1] string = removeTrailing(string) } if(length(grep("[×x]",string))>0){ string = gsub("[:space:]","",string) tmp1 = as.numeric(strsplit(string,"[×x]")[[1]][1]) tmp2 = as.numeric(strsplit(strsplit(string,"[×x]")[[1]][2],"[−-]")[[1]][2]) return(tmp1*10^(-tmp2)) }else{ return(as.numeric(string)) } }# -# A function to scrape the P-values from a vector of abstracts with corresponding # pubmed ids getPvalues = function(abstract,pmid){ pvalues = numeric(0) trunc = numeric(0) ids = numeric(0) # Get the truncated p-values ind = grep("[Pp][[:space:]]?[<≤]",abstract) for(i in 1:length(ind)){ tmp = strsplit(abstract[ind[i]],"[[:space:](][Pp][[:space:]]?[<≤]")[[1]] n = length(tmp) for(j in 1:n){ if(length(grep("[.0123456789]",substr(tmp[j],1,2))) > 0){ if(length(grep("[A-Z]",substr(tmp[j],1,1)))>0){next;} tmp2 = strsplit(tmp[j],"[^[:punct:][:digit:]x[:space:]]")[[1]][1] tmp2 = removeTrailing(tmp2) tmp2 = gsub(" ","",tmp2) tmp2 = convertScientific(tmp2) pvalues = c(pvalues,as.numeric(tmp2)) trunc = c(trunc,1) ids = c(ids,pmid[ind[i]]) } } } # Get the truncated p-values ind = grep("[Pp][[:space:]]?=",abstract) for(i in 1:length(ind)){ tmp = strsplit(abstract[ind[i]],"[[:space:](][Pp][[:space:]] -?=")[[1]] n = length(tmp) for(j in 1:n){ if(length(grep("[.0123456789]",substr(tmp[j],1,2))) > 0){ if(length(grep("[A-Z]",substr(tmp[j],1,1)))>0){next;} tmp2 = strsplit(tmp[j],"[^[:punct:][:space:][:digit:]x[:space:]]")[[1]][1] tmp2 = removeTrailing(tmp2) tmp2 = gsub(" ","",tmp2) tmp2 = convertScientific(tmp2) pvalues = c(pvalues,as.numeric(tmp2)) trunc = c(trunc,0) ids = c(ids,pmid[ind[i]]) } } } return(list(pvalues=pvalues,ids=ids,trunc=trunc)) }# -## Run the above functions over a specified set of journals and years ## to obtain P-values# -journals = c("JAMA","New England Journal of Medicine","BMJ","American Journal of Epidemiology","Lancet") years = 2000:2010 pvalueData = matrix(NA,nrow=1,ncol=6) colnames(pvalueData) = c("pvalue","pvalueTruncated","pubmedID","year","abstract","title") npapers = matrix(NA,nrow=length(journals),ncol=length(years)) for(i in 1:length(journals)){ for(j in 1:length(years)){ cat(journals[i]); cat(" "); cat(years[j]); cat(" "); tmpData = getAbstractsPmids(journals[i],years[j]) while(length(tmpData$abstracts) ==1 & is.na(tmpData$abstracts[1])){tmpData = getAbstractsPmids(journals[i],years[j])} cat("Downloaded"); cat(" "); npapers[i,j] = length(tmpData$abstracts) tmpOut = getPvalues(tmpData$abstracts,tmpData$pmid)# -nPvalues = length(tmpOut$pvalues) aa = match(tmpOut$ids,tmpData$pmid)# -tmpMatrix = cbind(tmpOut$pvalues,tmpOut$trunc,as.numeric(tmpOut$ids),rep(years[j],nPvalues),tmpData$abstracts[aa],tmpData$titles[aa]) rownames(tmpMatrix) = rep(journals[i],nPvalues) pvalueData = rbind(pvalueData,tmpMatrix) cat("Done\n") } }# -## These come from the paper Pubmed ID = 20876667 and are reports from ## a GWAS. Update some P-values that are incorrectly scraped because of ## variation in scientific notation. pvalueData[pvalueData[,1] == 10,1] = 10e-7 pvalueData = pvalueData[-1,] ## These come from the Lancet, with missed periods in the P-values pvalueData[13392,1] = 0.003 pvalueData[13413,1] = 0.014 pvalueData[13414,1] = 0.004 ## This one comes from the Lancet too, where an incorrect P-value is grabbed. pvalueData = pvalueData[-14674,]# -# Remove rows with P-values that are pvalueData = pvalueData[!is.na(pvalueData[,1]),] # This one for some reason replaced a period with "small middle dot" pvalueData[which(pvalueData[,3] == 11943262),1] = 1e-4 # This one has a <<< in the P-value definition pvalueData = pvalueData[-which(pvalueData[,3]=="16421237"),] # -save(pvalueData,npapers,file="pvalueDataTest.rda") -dim(pvalueData) -rm(list=ls()) -pvalueData[13413,1] = 0.014 pvalueData[13414,1] = 0.004 ## This one comes from the Lancet too, where an incorrect P-value is grabbed. pvalueData = pvalueData[-14674,]# -# Remove rows with P-values that are pvalueData = pvalueData[!is.na(pvalueData[,1]),] # This one for some reason replaced a period with "small middle dot" pvalueData[which(pvalueData[,3] == 11943262),1] = 1e-4 # This one has a <<< in the P-value definition pvalueData = pvalueData[-which(pvalueData[,3]=="16421237"),] # -save(pvalueData,npapers,file="pvalueDataTest.rda") -Functions to scrape P-values from Pubmed abstracts # Date: 7-1-12 # Copyright (C) 2011 Jeffrey T. Leek (http://www.biostat.jhsph.edu/~jleek/contact.html) and Leah R. Jager # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details, see . # # # Note: These functions were written on a Mac and may have difficulties when # read on windows machines. # ######################################################################################### -library(RCurl) library(XML) library(tm)# -# A function to get all abstracts and pubmed ids for papers from the journal "journaltitle" in the year "year" # by scraping the Pubmed API. getAbstractsPmids = function(journaltitle,year){ # esearch url <- "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?" q = paste("db=pubmed&term=",gsub(" ","+",journaltitle),"[ta]+AND+",year,"[dp]&usehistory=y",sep="") esearch <- xmlTreeParse(getURL(paste(url, q, sep="")), useInternal = T) webenv <- xmlValue(getNodeSet(esearch, "//WebEnv")[[1]]) key <- xmlValue(getNodeSet(esearch, "//QueryKey")[[1]]) # efetch url <- "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?" q <- "db=pubmed&retmode=xml&rettype=abstract" efetch <- xmlTreeParse(getURL(paste(url, q, "&WebEnv=", webenv, "&query_key=", key, sep="")), useInternal = T) r = xmlRoot(efetch) n = xmlSize(r) abstracts = pmid = titles = rep(NA,n) for(i in 1:n){abstracts[i] = xmlValue(r[[i]][[1]][["Article"]][["Abstract"]]); pmid[i] = xmlValue(r[[i]][[1]][["PMID"]]); titles[i] = xmlValue(r[[i]][[1 -]][["Article"]][["ArticleTitle"]]) } return(list(abstracts=abstracts,pmid=pmid,titles=titles)) }# -#A function to remove trailing zeros from the P-value strings removeTrailing = function(string){ while(length(grep("[0-9]",strsplit(string,"")[[1]][nchar(string)])) == 0){ string = substr(string,1,(nchar(string)-1)) } return(string) }# -# A function to convert the scientific notation used by journals into # numeric values that can be analyzed. convertScientific = function(string){ if(length(grep("[[:punct:]][[:space:]]",string))>0){ string = strsplit(string,"[[:punct:]][[:space:]]")[[1]][1] string = removeTrailing(string) } if(length(grep("[×x]",string))>0){ string = gsub("[:space:]","",string) tmp1 = as.numeric(strsplit(string,"[×x]")[[1]][1]) tmp2 = as.numeric(strsplit(strsplit(string,"[×x]")[[1]][2],"[−-]")[[1]][2]) return(tmp1*10^(-tmp2)) }else{ return(as.numeric(string)) } }# -# A function to scrape the P-values from a vector of abstracts with corresponding # pubmed ids getPvalues = function(abstract,pmid){ pvalues = numeric(0) trunc = numeric(0) ids = numeric(0) # Get the truncated p-values ind = grep("[Pp][[:space:]]?[<≤]",abstract) for(i in 1:length(ind)){ tmp = strsplit(abstract[ind[i]],"[[:space:](][Pp][[:space:]]?[<≤]")[[1]] n = length(tmp) for(j in 1:n){ if(length(grep("[.0123456789]",substr(tmp[j],1,2))) > 0){ if(length(grep("[A-Z]",substr(tmp[j],1,1)))>0){next;} tmp2 = strsplit(tmp[j],"[^[:punct:][:digit:]x[:space:]]")[[1]][1] tmp2 = removeTrailing(tmp2) tmp2 = gsub(" ","",tmp2) tmp2 = convertScientific(tmp2) pvalues = c(pvalues,as.numeric(tmp2)) trunc = c(trunc,1) ids = c(ids,pmid[ind[i]]) } } } # Get the truncated p-values ind = grep("[Pp][[:space:]]?=",abstract) for(i in 1:length(ind)){ tmp = strsplit(abstract[ind[i]],"[[:space:](][Pp][[:space:]] -?=")[[1]] n = length(tmp) for(j in 1:n){ if(length(grep("[.0123456789]",substr(tmp[j],1,2))) > 0){ if(length(grep("[A-Z]",substr(tmp[j],1,1)))>0){next;} tmp2 = strsplit(tmp[j],"[^[:punct:][:space:][:digit:]x[:space:]]")[[1]][1] tmp2 = removeTrailing(tmp2) tmp2 = gsub(" ","",tmp2) tmp2 = convertScientific(tmp2) pvalues = c(pvalues,as.numeric(tmp2)) trunc = c(trunc,0) ids = c(ids,pmid[ind[i]]) } } } return(list(pvalues=pvalues,ids=ids,trunc=trunc)) }# -## Run the above functions over a specified set of journals and years ## to obtain P-values# -journals = c("JAMA","New England Journal of Medicine","BMJ","American Journal of Epidemiology","Lancet") years = 2000:2010 pvalueData = matrix(NA,nrow=1,ncol=6) colnames(pvalueData) = c("pvalue","pvalueTruncated","pubmedID","year","abstract","title") npapers = matrix(NA,nrow=length(journals),ncol=length(years)) for(i in 1:length(journals)){ for(j in 1:length(years)){ cat(journals[i]); cat(" "); cat(years[j]); cat(" "); tmpData = getAbstractsPmids(journals[i],years[j]) while(length(tmpData$abstracts) ==1 & is.na(tmpData$abstracts[1])){tmpData = getAbstractsPmids(journals[i],years[j])} cat("Downloaded"); cat(" "); npapers[i,j] = length(tmpData$abstracts) tmpOut = getPvalues(tmpData$abstracts,tmpData$pmid)# -nPvalues = length(tmpOut$pvalues) aa = match(tmpOut$ids,tmpData$pmid)# -tmpMatrix = cbind(tmpOut$pvalues,tmpOut$trunc,as.numeric(tmpOut$ids),rep(years[j],nPvalues),tmpData$abstracts[aa],tmpData$titles[aa]) rownames(tmpMatrix) = rep(journals[i],nPvalues) pvalueData = rbind(pvalueData,tmpMatrix) cat("Done\n") } }# -## These come from the paper Pubmed ID = 20876667 and are reports from ## a GWAS. Update some P-values that are incorrectly scraped because of ## variation in scientific notation. pvalueData[pvalueData[,1] == 10,1] = 10e-7 pvalueData = pvalueData[-1,] ## These come from the Lancet, with missed periods in the P-values pvalueData[13392,1] = 0.003 pvalueData[13413,1] = 0.014 pvalueData[13414,1] = 0.004 ## This one comes from the Lancet too, where an incorrect P-value is grabbed. pvalueData = pvalueData[-14674,]# -# Remove rows with P-values that are pvalueData = pvalueData[!is.na(pvalueData[,1]),] # This one for some reason replaced a period with "small middle dot" pvalueData[which(pvalueData[,3] == 11943262),1] = 1e-4 # This one has a <<< in the P-value definition pvalueData = pvalueData[-which(pvalueData[,3]=="16421237"),] # -save(pvalueData,npapers,file="pvalueDataTest.rda") -Functions to scrape P-values from Pubmed abstracts # Date: 7-1-12 # Copyright (C) 2011 Jeffrey T. Leek (http://www.biostat.jhsph.edu/~jleek/contact.html) and Leah R. Jager # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details, see . # # # Note: These functions were written on a Mac and may have difficulties when # read on windows machines. # ######################################################################################### -library(RCurl) library(XML) library(tm)# -# A function to get all abstracts and pubmed ids for papers from the journal "journaltitle" in the year "year" # by scraping the Pubmed API. getAbstractsPmids = function(journaltitle,year){ # esearch url <- "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?" q = paste("db=pubmed&term=",gsub(" ","+",journaltitle),"[ta]+AND+",year,"[dp]&usehistory=y",sep="") esearch <- xmlTreeParse(getURL(paste(url, q, sep="")), useInternal = T) webenv <- xmlValue(getNodeSet(esearch, "//WebEnv")[[1]]) key <- xmlValue(getNodeSet(esearch, "//QueryKey")[[1]]) # efetch url <- "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?" q <- "db=pubmed&retmode=xml&rettype=abstract" efetch <- xmlTreeParse(getURL(paste(url, q, "&WebEnv=", webenv, "&query_key=", key, sep="")), useInternal = T) r = xmlRoot(efetch) n = xmlSize(r) abstracts = pmid = titles = rep(NA,n) for(i in 1:n){abstracts[i] = xmlValue(r[[i]][[1]][["Article"]][["Abstract"]]); pmid[i] = xmlValue(r[[i]][[1]][["PMID"]]); titles[i] = xmlValue(r[[i]][[1 -]][["Article"]][["ArticleTitle"]]) } return(list(abstracts=abstracts,pmid=pmid,titles=titles)) }# -#A function to remove trailing zeros from the P-value strings removeTrailing = function(string){ while(length(grep("[0-9]",strsplit(string,"")[[1]][nchar(string)])) == 0){ string = substr(string,1,(nchar(string)-1)) } return(string) }# -# A function to convert the scientific notation used by journals into # numeric values that can be analyzed. convertScientific = function(string){ if(length(grep("[[:punct:]][[:space:]]",string))>0){ string = strsplit(string,"[[:punct:]][[:space:]]")[[1]][1] string = removeTrailing(string) } if(length(grep("[×x]",string))>0){ string = gsub("[:space:]","",string) tmp1 = as.numeric(strsplit(string,"[×x]")[[1]][1]) tmp2 = as.numeric(strsplit(strsplit(string,"[×x]")[[1]][2],"[−-]")[[1]][2]) return(tmp1*10^(-tmp2)) }else{ return(as.numeric(string)) } }# -# A function to scrape the P-values from a vector of abstracts with corresponding # pubmed ids getPvalues = function(abstract,pmid){ pvalues = numeric(0) trunc = numeric(0) ids = numeric(0) # Get the truncated p-values ind = grep("[Pp][[:space:]]?[<≤]",abstract) for(i in 1:length(ind)){ tmp = strsplit(abstract[ind[i]],"[[:space:](][Pp][[:space:]]?[<≤]")[[1]] n = length(tmp) for(j in 1:n){ if(length(grep("[.0123456789]",substr(tmp[j],1,2))) > 0){ if(length(grep("[A-Z]",substr(tmp[j],1,1)))>0){next;} tmp2 = strsplit(tmp[j],"[^[:punct:][:digit:]x[:space:]]")[[1]][1] tmp2 = removeTrailing(tmp2) tmp2 = gsub(" ","",tmp2) tmp2 = convertScientific(tmp2) pvalues = c(pvalues,as.numeric(tmp2)) trunc = c(trunc,1) ids = c(ids,pmid[ind[i]]) } } } # Get the truncated p-values ind = grep("[Pp][[:space:]]?=",abstract) for(i in 1:length(ind)){ tmp = strsplit(abstract[ind[i]],"[[:space:](][Pp][[:space:]] -?=")[[1]] n = length(tmp) for(j in 1:n){ if(length(grep("[.0123456789]",substr(tmp[j],1,2))) > 0){ if(length(grep("[A-Z]",substr(tmp[j],1,1)))>0){next;} tmp2 = strsplit(tmp[j],"[^[:punct:][:space:][:digit:]x[:space:]]")[[1]][1] tmp2 = removeTrailing(tmp2) tmp2 = gsub(" ","",tmp2) tmp2 = convertScientific(tmp2) pvalues = c(pvalues,as.numeric(tmp2)) trunc = c(trunc,0) ids = c(ids,pmid[ind[i]]) } } } return(list(pvalues=pvalues,ids=ids,trunc=trunc)) }# -## Run the above functions over a specified set of journals and years ## to obtain P-values# -journals = c("JAMA","New England Journal of Medicine","BMJ","American Journal of Epidemiology","Lancet") years = 2000:2010 pvalueData = matrix(NA,nrow=1,ncol=6) colnames(pvalueData) = c("pvalue","pvalueTruncated","pubmedID","year","abstract","title") npapers = matrix(NA,nrow=length(journals),ncol=length(years)) for(i in 1:length(journals)){ for(j in 1:length(years)){ cat(journals[i]); cat(" "); cat(years[j]); cat(" "); tmpData = getAbstractsPmids(journals[i],years[j]) while(length(tmpData$abstracts) ==1 & is.na(tmpData$abstracts[1])){tmpData = getAbstractsPmids(journals[i],years[j])} cat("Downloaded"); cat(" "); npapers[i,j] = length(tmpData$abstracts) tmpOut = getPvalues(tmpData$abstracts,tmpData$pmid)# -nPvalues = length(tmpOut$pvalues) aa = match(tmpOut$ids,tmpData$pmid)# -tmpMatrix = cbind(tmpOut$pvalues,tmpOut$trunc,as.numeric(tmpOut$ids),rep(years[j],nPvalues),tmpData$abstracts[aa],tmpData$titles[aa]) rownames(tmpMatrix) = rep(journals[i],nPvalues) pvalueData = rbind(pvalueData,tmpMatrix) cat("Done\n") } }# -## These come from the paper Pubmed ID = 20876667 and are reports from ## a GWAS. Update some P-values that are incorrectly scraped because of ## variation in scientific notation. pvalueData[pvalueData[,1] == 10,1] = 10e-7 pvalueData = pvalueData[-1,] ## These come from the Lancet, with missed periods in the P-values pvalueData[13392,1] = 0.003 pvalueData[13413,1] = 0.014 pvalueData[13414,1] = 0.004 ## This one comes from the Lancet too, where an incorrect P-value is grabbed. pvalueData = pvalueData[-14674,]# -# Remove rows with P-values that are pvalueData = pvalueData[!is.na(pvalueData[,1]),] # This one for some reason replaced a period with "small middle dot" pvalueData[which(pvalueData[,3] == 11943262),1] = 1e-4 # This one has a <<< in the P-value definition pvalueData = pvalueData[-which(pvalueData[,3]=="16421237"),] # -save(pvalueData,npapers,file="pvalueData.rda") -Functions to scrape P-values from Pubmed abstracts # Date: 7-1-12 # Copyright (C) 2011 Jeffrey T. Leek (http://www.biostat.jhsph.edu/~jleek/contact.html) and Leah R. Jager # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details, see . # # # Note: These functions were written on a Mac and may have difficulties when # read on windows machines. # ######################################################################################### -library(RCurl) library(XML) library(tm)# -# A function to get all abstracts and pubmed ids for papers from the journal "journaltitle" in the year "year" # by scraping the Pubmed API. getAbstractsPmids = function(journaltitle,year){ # esearch url <- "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?" q = paste("db=pubmed&term=",gsub(" ","+",journaltitle),"[ta]+AND+",year,"[dp]&usehistory=y",sep="") esearch <- xmlTreeParse(getURL(paste(url, q, sep="")), useInternal = T) webenv <- xmlValue(getNodeSet(esearch, "//WebEnv")[[1]]) key <- xmlValue(getNodeSet(esearch, "//QueryKey")[[1]]) # efetch url <- "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?" q <- "db=pubmed&retmode=xml&rettype=abstract" efetch <- xmlTreeParse(getURL(paste(url, q, "&WebEnv=", webenv, "&query_key=", key, sep="")), useInternal = T) r = xmlRoot(efetch) n = xmlSize(r) abstracts = pmid = titles = rep(NA,n) for(i in 1:n){abstracts[i] = xmlValue(r[[i]][[1]][["Article"]][["Abstract"]]); pmid[i] = xmlValue(r[[i]][[1]][["PMID"]]); titles[i] = xmlValue(r[[i]][[1 -]][["Article"]][["ArticleTitle"]]) } return(list(abstracts=abstracts,pmid=pmid,titles=titles)) }# -#A function to remove trailing zeros from the P-value strings removeTrailing = function(string){ while(length(grep("[0-9]",strsplit(string,"")[[1]][nchar(string)])) == 0){ string = substr(string,1,(nchar(string)-1)) } return(string) }# -# A function to convert the scientific notation used by journals into # numeric values that can be analyzed. convertScientific = function(string){ if(length(grep("[[:punct:]][[:space:]]",string))>0){ string = strsplit(string,"[[:punct:]][[:space:]]")[[1]][1] string = removeTrailing(string) } if(length(grep("[×x]",string))>0){ string = gsub("[:space:]","",string) tmp1 = as.numeric(strsplit(string,"[×x]")[[1]][1]) tmp2 = as.numeric(strsplit(strsplit(string,"[×x]")[[1]][2],"[−-]")[[1]][2]) return(tmp1*10^(-tmp2)) }else{ return(as.numeric(string)) } }# -# A function to scrape the P-values from a vector of abstracts with corresponding # pubmed ids getPvalues = function(abstract,pmid){ pvalues = numeric(0) trunc = numeric(0) ids = numeric(0) # Get the truncated p-values ind = grep("[Pp][[:space:]]?[<≤]",abstract) for(i in 1:length(ind)){ tmp = strsplit(abstract[ind[i]],"[[:space:](][Pp][[:space:]]?[<≤]")[[1]] n = length(tmp) for(j in 1:n){ if(length(grep("[.0123456789]",substr(tmp[j],1,2))) > 0){ if(length(grep("[A-Z]",substr(tmp[j],1,1)))>0){next;} tmp2 = strsplit(tmp[j],"[^[:punct:][:digit:]x[:space:]]")[[1]][1] tmp2 = removeTrailing(tmp2) tmp2 = gsub(" ","",tmp2) tmp2 = convertScientific(tmp2) pvalues = c(pvalues,as.numeric(tmp2)) trunc = c(trunc,1) ids = c(ids,pmid[ind[i]]) } } } # Get the truncated p-values ind = grep("[Pp][[:space:]]?=",abstract) for(i in 1:length(ind)){ tmp = strsplit(abstract[ind[i]],"[[:space:](][Pp][[:space:]] -?=")[[1]] n = length(tmp) for(j in 1:n){ if(length(grep("[.0123456789]",substr(tmp[j],1,2))) > 0){ if(length(grep("[A-Z]",substr(tmp[j],1,1)))>0){next;} tmp2 = strsplit(tmp[j],"[^[:punct:][:space:][:digit:]x[:space:]]")[[1]][1] tmp2 = removeTrailing(tmp2) tmp2 = gsub(" ","",tmp2) tmp2 = convertScientific(tmp2) pvalues = c(pvalues,as.numeric(tmp2)) trunc = c(trunc,0) ids = c(ids,pmid[ind[i]]) } } } return(list(pvalues=pvalues,ids=ids,trunc=trunc)) }# -## Run the above functions over a specified set of journals and years ## to obtain P-values# -journals = c("JAMA","New England Journal of Medicine","BMJ","American Journal of Epidemiology","Lancet") years = 2000:2010 pvalueData = matrix(NA,nrow=1,ncol=6) colnames(pvalueData) = c("pvalue","pvalueTruncated","pubmedID","year","abstract","title") npapers = matrix(NA,nrow=length(journals),ncol=length(years)) for(i in 1:length(journals)){ for(j in 1:length(years)){ cat(journals[i]); cat(" "); cat(years[j]); cat(" "); tmpData = getAbstractsPmids(journals[i],years[j]) while(length(tmpData$abstracts) ==1 & is.na(tmpData$abstracts[1])){tmpData = getAbstractsPmids(journals[i],years[j])} cat("Downloaded"); cat(" "); npapers[i,j] = length(tmpData$abstracts) tmpOut = getPvalues(tmpData$abstracts,tmpData$pmid)# -nPvalues = length(tmpOut$pvalues) aa = match(tmpOut$ids,tmpData$pmid)# -tmpMatrix = cbind(tmpOut$pvalues,tmpOut$trunc,as.numeric(tmpOut$ids),rep(years[j],nPvalues),tmpData$abstracts[aa],tmpData$titles[aa]) rownames(tmpMatrix) = rep(journals[i],nPvalues) pvalueData = rbind(pvalueData,tmpMatrix) cat("Done\n") } }# -## These come from the paper Pubmed ID = 20876667 and are reports from ## a GWAS. Update some P-values that are incorrectly scraped because of ## variation in scientific notation. pvalueData[pvalueData[,1] == 10,1] = 10e-7 pvalueData = pvalueData[-1,] ## These come from the Lancet, with missed periods in the P-values pvalueData[13392,1] = 0.003 pvalueData[13413,1] = 0.014 pvalueData[13414,1] = 0.004 ## This one comes from the Lancet too, where an incorrect P-value is grabbed. pvalueData = pvalueData[-14674,]# -# Remove rows with P-values that are pvalueData = pvalueData[!is.na(pvalueData[,1]),] # This one for some reason replaced a period with "small middle dot" pvalueData[which(pvalueData[,3] == 11943262),1] = 1e-4 # This one has a <<< in the P-value definition pvalueData = pvalueData[-which(pvalueData[,3]=="16421237"),] # -save(pvalueData,npapers,file="pvalueData.rda") -Functions to scrape P-values from Pubmed abstracts # Date: 7-1-12 # Copyright (C) 2011 Jeffrey T. Leek (http://www.biostat.jhsph.edu/~jleek/contact.html) and Leah R. Jager # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details, see . # # # Note: These functions were written on a Mac and may have difficulties when # read on windows machines. # ######################################################################################### -library(RCurl) library(XML) library(tm)# -# A function to get all abstracts and pubmed ids for papers from the journal "journaltitle" in the year "year" # by scraping the Pubmed API. getAbstractsPmids = function(journaltitle,year){ # esearch url <- "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?" q = paste("db=pubmed&term=",gsub(" ","+",journaltitle),"[ta]+AND+",year,"[dp]&usehistory=y",sep="") esearch <- xmlTreeParse(getURL(paste(url, q, sep="")), useInternal = T) webenv <- xmlValue(getNodeSet(esearch, "//WebEnv")[[1]]) key <- xmlValue(getNodeSet(esearch, "//QueryKey")[[1]]) # efetch url <- "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?" q <- "db=pubmed&retmode=xml&rettype=abstract" efetch <- xmlTreeParse(getURL(paste(url, q, "&WebEnv=", webenv, "&query_key=", key, sep="")), useInternal = T) r = xmlRoot(efetch) n = xmlSize(r) abstracts = pmid = titles = rep(NA,n) for(i in 1:n){abstracts[i] = xmlValue(r[[i]][[1]][["Article"]][["Abstract"]]); pmid[i] = xmlValue(r[[i]][[1]][["PMID"]]); titles[i] = xmlValue(r[[i]][[1 -]][["Article"]][["ArticleTitle"]]) } return(list(abstracts=abstracts,pmid=pmid,titles=titles)) }# -#A function to remove trailing zeros from the P-value strings removeTrailing = function(string){ while(length(grep("[0-9]",strsplit(string,"")[[1]][nchar(string)])) == 0){ string = substr(string,1,(nchar(string)-1)) } return(string) }# -# A function to convert the scientific notation used by journals into # numeric values that can be analyzed. convertScientific = function(string){ if(length(grep("[[:punct:]][[:space:]]",string))>0){ string = strsplit(string,"[[:punct:]][[:space:]]")[[1]][1] string = removeTrailing(string) } if(length(grep("[×x]",string))>0){ string = gsub("[:space:]","",string) tmp1 = as.numeric(strsplit(string,"[×x]")[[1]][1]) tmp2 = as.numeric(strsplit(strsplit(string,"[×x]")[[1]][2],"[−-]")[[1]][2]) return(tmp1*10^(-tmp2)) }else{ return(as.numeric(string)) } }# -# A function to scrape the P-values from a vector of abstracts with corresponding # pubmed ids getPvalues = function(abstract,pmid){ pvalues = numeric(0) trunc = numeric(0) ids = numeric(0) # Get the truncated p-values ind = grep("[Pp][[:space:]]?[<≤]",abstract) for(i in 1:length(ind)){ tmp = strsplit(abstract[ind[i]],"[[:space:](][Pp][[:space:]]?[<≤]")[[1]] n = length(tmp) for(j in 1:n){ if(length(grep("[.0123456789]",substr(tmp[j],1,2))) > 0){ if(length(grep("[A-Z]",substr(tmp[j],1,1)))>0){next;} tmp2 = strsplit(tmp[j],"[^[:punct:][:digit:]x[:space:]]")[[1]][1] tmp2 = removeTrailing(tmp2) tmp2 = gsub(" ","",tmp2) tmp2 = convertScientific(tmp2) pvalues = c(pvalues,as.numeric(tmp2)) trunc = c(trunc,1) ids = c(ids,pmid[ind[i]]) } } } # Get the truncated p-values ind = grep("[Pp][[:space:]]?=",abstract) for(i in 1:length(ind)){ tmp = strsplit(abstract[ind[i]],"[[:space:](][Pp][[:space:]] -?=")[[1]] n = length(tmp) for(j in 1:n){ if(length(grep("[.0123456789]",substr(tmp[j],1,2))) > 0){ if(length(grep("[A-Z]",substr(tmp[j],1,1)))>0){next;} tmp2 = strsplit(tmp[j],"[^[:punct:][:space:][:digit:]x[:space:]]")[[1]][1] tmp2 = removeTrailing(tmp2) tmp2 = gsub(" ","",tmp2) tmp2 = convertScientific(tmp2) pvalues = c(pvalues,as.numeric(tmp2)) trunc = c(trunc,0) ids = c(ids,pmid[ind[i]]) } } } return(list(pvalues=pvalues,ids=ids,trunc=trunc)) }# -## Run the above functions over a specified set of journals and years ## to obtain P-values# -journals = c("JAMA","New England Journal of Medicine","BMJ","American Journal of Epidemiology","Lancet") years = 2000:2010 pvalueData = matrix(NA,nrow=1,ncol=6) colnames(pvalueData) = c("pvalue","pvalueTruncated","pubmedID","year","abstract","title") npapers = matrix(NA,nrow=length(journals),ncol=length(years)) for(i in 1:length(journals)){ for(j in 1:length(years)){ cat(journals[i]); cat(" "); cat(years[j]); cat(" "); tmpData = getAbstractsPmids(journals[i],years[j]) while(length(tmpData$abstracts) ==1 & is.na(tmpData$abstracts[1])){tmpData = getAbstractsPmids(journals[i],years[j])} cat("Downloaded"); cat(" "); npapers[i,j] = length(tmpData$abstracts) tmpOut = getPvalues(tmpData$abstracts,tmpData$pmid)# -nPvalues = length(tmpOut$pvalues) aa = match(tmpOut$ids,tmpData$pmid)# -tmpMatrix = cbind(tmpOut$pvalues,tmpOut$trunc,as.numeric(tmpOut$ids),rep(years[j],nPvalues),tmpData$abstracts[aa],tmpData$titles[aa]) rownames(tmpMatrix) = rep(journals[i],nPvalues) pvalueData = rbind(pvalueData,tmpMatrix) cat("Done\n") } } -Functions to scrape P-values from Pubmed abstracts # Date: 7-1-12 # Copyright (C) 2011 Jeffrey T. Leek (http://www.biostat.jhsph.edu/~jleek/contact.html) and Leah R. Jager # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details, see . # # # Note: These functions were written on a Mac and may have difficulties when # read on windows machines. # ######################################################################################### -library(RCurl) library(XML) library(tm)# -# A function to get all abstracts and pubmed ids for papers from the journal "journaltitle" in the year "year" # by scraping the Pubmed API. getAbstractsPmids = function(journaltitle,year){ # esearch url <- "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?" q = paste("db=pubmed&term=",gsub(" ","+",journaltitle),"[ta]+AND+",year,"[dp]&usehistory=y",sep="") esearch <- xmlTreeParse(getURL(paste(url, q, sep="")), useInternal = T) webenv <- xmlValue(getNodeSet(esearch, "//WebEnv")[[1]]) key <- xmlValue(getNodeSet(esearch, "//QueryKey")[[1]]) # efetch url <- "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?" q <- "db=pubmed&retmode=xml&rettype=abstract" efetch <- xmlTreeParse(getURL(paste(url, q, "&WebEnv=", webenv, "&query_key=", key, sep="")), useInternal = T) r = xmlRoot(efetch) n = xmlSize(r) abstracts = pmid = titles = rep(NA,n) for(i in 1:n){abstracts[i] = xmlValue(r[[i]][[1]][["Article"]][["Abstract"]]); pmid[i] = xmlValue(r[[i]][[1]][["PMID"]]); titles[i] = xmlValue(r[[i]][[1]][["Article"]][["ArticleTitle"]]) } return(list(abstracts=abstracts,pmid=pmid,titles=titles)) }# -#A function to remove trailing zeros from the P-value strings removeTrailing = function(string){ while(length(grep("[0-9]",strsplit(string,"")[[1]][nchar(string)])) == 0){ string = substr(string,1,(nchar(string)-1)) } return(string) }# -# A function to convert the scientific notation used by journals into # numeric values that can be analyzed. convertScientific = function(string){ if(length(grep("[[:punct:]][[:space:]]",string))>0){ string = strsplit(string,"[[:punct:]][[:space:]]")[[1]][1] string = removeTrailing(string) } if(length(grep("[×x]",string))>0){ string = gsub("[:space:]","",string) tmp1 = as.numeric(strsplit(string,"[×x]")[[1]][1]) tmp2 = as.numeric(strsplit(strsplit(string,"[×x]")[[1]][2],"[−-]")[[1]][2]) return(tmp1*10^(-tmp2)) }else{ return(as.numeric(string)) } }# -# A function to scrape the P-values from a vector of abstracts with corresponding # pubmed ids getPvalues = function(abstract,pmid){ pvalues = numeric(0) trunc = numeric(0) ids = numeric(0) # Get the truncated p-values ind = grep("[Pp][[:space:]]?[<≤]",abstract) for(i in 1:length(ind)){ tmp = strsplit(abstract[ind[i]],"[[:space:](][Pp][[:space:]]?[<≤]")[[1]] n = length(tmp) for(j in 1:n){ if(length(grep("[.0123456789]",substr(tmp[j],1,2))) > 0){ if(length(grep("[A-Z]",substr(tmp[j],1,1)))>0){next;} tmp2 = strsplit(tmp[j],"[^[:punct:][:digit:]x[:space:]]")[[1]][1] tmp2 = removeTrailing(tmp2) tmp2 = gsub(" ","",tmp2) tmp2 = convertScientific(tmp2) pvalues = c(pvalues,as.numeric(tmp2)) trunc = c(trunc,1) ids = c(ids,pmid[ind[i]]) } } } # Get the truncated p-values ind = grep("[Pp][[:space:]]?=",abstract) for(i in 1:length(ind)){ tmp = strsplit(abstract[ind[i]],"[[:space:](][Pp][[:space:]]?=")[[1]] n = length(tmp) for(j in 1:n){ if(length(grep("[.0123456789]",substr(tmp[j],1,2))) > 0){ if(length(grep("[A-Z]",substr(tmp[j],1,1)))>0){next;} tmp2 = strsplit(tmp[j],"[^[:punct:][:space:][:digit:]x[:space:]]")[[1]][1] tmp2 = removeTrailing(tmp2) tmp2 = gsub(" ","",tmp2) tmp2 = convertScientific(tmp2) pvalues = c(pvalues,as.numeric(tmp2)) trunc = c(trunc,0) ids = c(ids,pmid[ind[i]]) } } } return(list(pvalues=pvalues,ids=ids,trunc=trunc)) } -journals = c("JAMA","New England Journal of Medicine","BMJ","American Journal of Epidemiology","Lancet") years = 2000:2010 pvalueData = matrix(NA,nrow=1,ncol=6) colnames(pvalueData) = c("pvalue","pvalueTruncated","pubmedID","year","abstract","title") npapers = matrix(NA,nrow=length(journals),ncol=length(years)) for(i in 1:length(journals)){ for(j in 1:length(years)){ cat(journals[i]); cat(" "); cat(years[j]); cat(" "); tmpData = getAbstractsPmids(journals[i],years[j]) while(length(tmpData$abstracts) ==1 & is.na(tmpData$abstracts[1])){tmpData = getAbstractsPmids(journals[i],years[j])} cat("Downloaded"); cat(" "); npapers[i,j] = length(tmpData$abstracts) tmpOut = getPvalues(tmpData$abstracts,tmpData$pmid)# -nPvalues = length(tmpOut$pvalues) aa = match(tmpOut$ids,tmpData$pmid)# -tmpMatrix = cbind(tmpOut$pvalues,tmpOut$trunc,as.numeric(tmpOut$ids),rep(years[j],nPvalues),tmpData$abstracts[aa],tmpData$titles[aa]) rownames(tmpMatrix) = rep(journals[i],nPvalues) pvalueData = rbind(pvalueData,tmpMatrix) cat("Done\n") } } -tmpData -i -j -tmpData = getAbstractsPmids(journals[i],years[j]) -while(length(tmpData$abstracts) ==1 & is.na(tmpData$abstracts[1])){tmpData = getAbstractsPmids(journals[i],years[j])} cat("Downloaded"); cat(" "); npapers[i,j] = length(tmpData$abstracts) tmpOut = getPvalues(tmpData$abstracts,tmpData$pmid)# -nPvalues = length(tmpOut$pvalues) aa = match(tmpOut$ids,tmpData$pmid)# -tmpMatrix = cbind(tmpOut$pvalues,tmpOut$trunc,as.numeric(tmpOut$ids),rep(years[j],nPvalues),tmpData$abstracts[aa],tmpData$titles[aa]) rownames(tmpMatrix) = rep(journals[i],nPvalues) pvalueData = rbind(pvalueData,tmpMatrix) cat("Done\n") -journals = c("JAMA","New England Journal of Medicine","BMJ","American Journal of Epidemiology","Lancet") years = 2000:2010 pvalueData = matrix(NA,nrow=1,ncol=6) colnames(pvalueData) = c("pvalue","pvalueTruncated","pubmedID","year","abstract","title") npapers = matrix(NA,nrow=length(journals),ncol=length(years)) for(i in 1:length(journals)){ for(j in 1:length(years)){ cat(journals[i]); cat(" "); cat(years[j]); cat(" "); tmpData = getAbstractsPmids(journals[i],years[j]) while(length(tmpData$abstracts) ==1 & is.na(tmpData$abstracts[1])){tmpData = getAbstractsPmids(journals[i],years[j])} cat("Downloaded"); cat(" "); npapers[i,j] = length(tmpData$abstracts) tmpOut = getPvalues(tmpData$abstracts,tmpData$pmid)# -nPvalues = length(tmpOut$pvalues) aa = match(tmpOut$ids,tmpData$pmid)# -tmpMatrix = cbind(tmpOut$pvalues,tmpOut$trunc,as.numeric(tmpOut$ids),rep(years[j],nPvalues),tmpData$abstracts[aa],tmpData$titles[aa]) rownames(tmpMatrix) = rep(journals[i],nPvalues) pvalueData = rbind(pvalueData,tmpMatrix) cat("Done\n") } } -barplot(c(1,1,-3)) -?barplot -pres12 = read.csv("~/Desktop/2012-pres.csv") -pres12[1,] -pres08 = read.csv("~/Desktop/2008pres.csv") -pres08[1,] -sum(pres12$FIPS == 0) -table(pres12$X[pres12$FIPS==0,]) -table(pres12$X[pres12$FIPS==0]) -pres12[pres12$X=="OK",] -pres12 = pres12[pres12$FIPS==0,] -dim(pres12) -pres12[1,] -pres12[2,] -pres12 = read.csv("~/Desktop/2012-pres.csv") -pres12[1:10,] -pres12[21:30,] -pres12[50:100,] -pres12 = pres12[pres12$FIPS==0,] -length(unique(pres12$X)) -which.max(pres12$X == "OK") -which(pres12$X == "OK") -pres12[c(36,37)] -pres12[c(36,37),] -pres12[1,] -pres12[1,5] -pres12[1,4] -as.numeric(pres12[1,4]) -as.numeric(as.character(pres12[1,4]) -) -as.numeric(as.character(pres12[1,4])) -pres08[1,] -sum(pres08$LAST.NAME == "McCain") -sum(pres08$LAST.NAME == "McCain" & pres08$STATE=="Alabama") -pres08[pres08$LAST.NAME == "McCain",] -pres12 = read.csv("~/Desktop/2012-pres.csv") -pres12 = pres12[pres12$FIPS==0,] -pres12[1,] -table(unique(pres12)) -table(unique(pres12$x)) -table(unique(pres12$X)) -substr -gsub -gsub(pres12[1,3]) -pres12[1,] -pres12$Obama.vote[1] -dem12 = as.character(pres12$Obama.vote) -dem12[1] -dem12 = sapply(dem12,function(x){gsub(x,",","")}) -dem12[1] -dem12 = as.character(pres12$Obama.vote) -gsub(dem12[1],",","") -?gsub -gsub(",","",dem12[1]) -dem12 = as.character(pres12$Obama.vote) -dem12 = as.numeric(sapply(dem12,function(x){gsub(",","",x)})) -dem12[1] -hist(dem12) -pres12 = read.csv("~/Desktop/2012-pres.csv") -pres12 = pres12[pres12$FIPS==0,] -dem12 = as.character(pres12$Obama.vote) -dem12 = as.numeric(sapply(dem12,function(x){gsub(",","",x)})) -rep12 = as.character(pres12$Romney.vote) -rep12 = as.numeric(sapply(rep12,function(x){gsub(",","",x)})) -plot(rep12,dem12) -rep12[1] -pres12[1,] -table(pres12[,2]) -res12 = read.csv("~/Desktop/2012-pres.csv") -pres12 = pres12[pres12$FIPS==0,] -table(pres12[,2]) -table(pres12[,1]) -library(XML) -theurl <- "http://uselectionatlas.org/RESULTS/data.php?year=2008&datatype=national&def=1&f=0&off=0&elect=0" -tables <- readHTMLTable(theurl) -tables[1,] -dim(tables) -tables[1] -tables -n.rows <- unlist(lapply(tables, function(t) dim(t)[1])) -n.rows -library(slidify) -?author -setwd("~/Documents/Work/teaching/2013/coursera/") -ls() -list.files() -author("gettingStarted") -slidify("gettingStarted") -ls() -list.files() -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -setwd("~/Documents/Work/teaching/2013/coursera/") -setwd("week1/gettingHelp/") -slidify("index.Rmd") -library(slidify) -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") diff --git a/007typesOfQuestions/.Rhistory b/007typesOfQuestions/.Rhistory deleted file mode 100644 index 95c1638..0000000 --- a/007typesOfQuestions/.Rhistory +++ /dev/null @@ -1,512 +0,0 @@ -points(x=runif(4,-4,4),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3) -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-4,4),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-4,4),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -?symbols -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -symbols(0,7.5,stars=matrix(c(1,1,1),nrow=1),col="gold") -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -symbols(0,7.5,stars=matrix(c(1,1,1,1,1),nrow=1),col="gold",add=T) -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -symbols(0,7.5,stars=matrix(c(1,1,1,1,1,1),nrow=1),col="gold",add=T) -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold") -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -?rect -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(3,-4.5,4.5) -rect(xPres-0.5,rep(0,3),xPres+0.5,runi(3,0,1),col=sample(c("blue","red"),size=3,replace=T)) -# Add some presents -xPres = runif(3,-4.5,4.5) -rect(xPres-0.5,rep(0,3),xPres+0.5,runif(3,0,1),col=sample(c("blue","red"),size=3,replace=T)) -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -rect(xPres-0.5,rep(0,10),xPres+0.5,runif(10,0,1),col=sample(c("blue","red"),size=10,replace=T)) -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0,0.5) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],rep(0,10),xPres[i]+xWidth[i],runif(10,0,1),col=sample(c("blue","red"),size=1)) -} -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0,0.5) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],0,xPres[i]+xWidth[i],runif(1,0,1),col=sample(c("blue","red"),size=1)) -} -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0,0.5) -xHeight=runif(10,0,1) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],0,xPres[i]+xWidth[i],xHeight[i],col=sample(c("blue","red"),size=1)) -rect(xPres[i]-0.1*xWidth[i],0,xPres[i]+0.1*xWidth[i],xHeight[i],col="gold") -} -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0,0.5) -xHeight=runif(10,0,1) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],0,xPres[i]+xWidth[i],xHeight[i],col=sample(c("blue","red"),size=1)) -rect(xPres[i]-0.2*xWidth[i],0,xPres[i]+0.2*xWidth[i],xHeight[i],col=sample("gold","silver")) -} -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0,0.5) -xHeight=runif(10,0,1) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],0,xPres[i]+xWidth[i],xHeight[i],col=sample(c("blue","red"),size=1)) -rect(xPres[i]-0.2*xWidth[i],0,xPres[i]+0.2*xWidth[i],xHeight[i],col=sample(c("gold","silver"),size=1) -} -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0,0.5) -xHeight=runif(10,0,1) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],0,xPres[i]+xWidth[i],xHeight[i],col=sample(c("blue","red"),size=1)) -rect(xPres[i]-0.2*xWidth[i],0,xPres[i]+0.2*xWidth[i],xHeight[i],col=sample(c("gold","silver"),size=1)) -} -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0,0.5) -xHeight=runif(10,0,1) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],0,xPres[i]+xWidth[i],xHeight[i],col=sample(c("blue","red"),size=1)) -rect(xPres[i]-0.2*xWidth[i],0,xPres[i]+0.2*xWidth[i],xHeight[i],col=sample(c("gold","grey87"),size=1)) -} -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0.1,0.5) -xHeight=runif(10,0,1) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],0,xPres[i]+xWidth[i],xHeight[i],col=sample(c("blue","red"),size=1)) -rect(xPres[i]-0.2*xWidth[i],0,xPres[i]+0.2*xWidth[i],xHeight[i],col=sample(c("gold","grey87"),size=1)) -} -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0.1,0.5) -xHeight=runif(10,0,1) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],0,xPres[i]+xWidth[i],xHeight[i],col=sample(c("blue","red"),size=1)) -rect(xPres[i]-0.2*xWidth[i],0,xPres[i]+0.2*xWidth[i],xHeight[i],col=sample(c("gold","grey87"),size=1)) -} -?png -png("xmas.png",height=2*480,width=480) - -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0.1,0.5) -xHeight=runif(10,0,1) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],0,xPres[i]+xWidth[i],xHeight[i],col=sample(c("blue","red"),size=1)) -rect(xPres[i]-0.2*xWidth[i],0,xPres[i]+0.2*xWidth[i],xHeight[i],col=sample(c("gold","grey87"),size=1)) -} -dev.off() -pvals = runif(10000) -pvals05 = pvals[pvals < 0.05] -hist(pvals05) -data() -?network -install.packages("ergm") -library(ergm) -?network -m <- matrix(rbinom(25,1,.4),5,5) -diag(m) <- 0 -g <- network(m, directed=FALSE) -summary(g) -m -ss = svd(M) -ss = svd(m) -plot(ss$v[,1]) -ss$u[,1] %*% t(ss$v[,1]) -ss$d[1]*ss$u[,1] %*% t(ss$v[,1]) -x = 3 asdfa -setwd("~/Documents/Work/teaching/2013/coursera/") -setwd("week1/gettingHelp/") -slidify("index.Rmd") -library(slidify) -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -setwd("../whatIsData/") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") -browseURL("index.html") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -browseURL("index.html") -slidify("index.Rmd") -slidify("index.Rmd") -slidify("index.Rmd") diff --git a/008sourcesOfDataSets/.Rhistory b/008sourcesOfDataSets/.Rhistory deleted file mode 100644 index 4eda0f2..0000000 --- a/008sourcesOfDataSets/.Rhistory +++ /dev/null @@ -1,512 +0,0 @@ -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -symbols(runif(4,-4,4),rep(2,4),circles=rep(0.1,4),fg=sample(c("blue","red"),size=4,replace=T),add=T) -?symbols -symbols(x=runif(4,-4,4),y=rep(2,4),circles=rep(0.01,4),bg=sample(c("blue","red"),size=4,replace=T),add=T) -rep(0.01,4) -points(x=runif(4,-4,4),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3) -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-4,4),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-4,4),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -?symbols -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -symbols(0,7.5,stars=matrix(c(1,1,1),nrow=1),col="gold") -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -symbols(0,7.5,stars=matrix(c(1,1,1,1,1),nrow=1),col="gold",add=T) -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -symbols(0,7.5,stars=matrix(c(1,1,1,1,1,1),nrow=1),col="gold",add=T) -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold") -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -?rect -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(3,-4.5,4.5) -rect(xPres-0.5,rep(0,3),xPres+0.5,runi(3,0,1),col=sample(c("blue","red"),size=3,replace=T)) -# Add some presents -xPres = runif(3,-4.5,4.5) -rect(xPres-0.5,rep(0,3),xPres+0.5,runif(3,0,1),col=sample(c("blue","red"),size=3,replace=T)) -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -rect(xPres-0.5,rep(0,10),xPres+0.5,runif(10,0,1),col=sample(c("blue","red"),size=10,replace=T)) -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0,0.5) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],rep(0,10),xPres[i]+xWidth[i],runif(10,0,1),col=sample(c("blue","red"),size=1)) -} -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0,0.5) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],0,xPres[i]+xWidth[i],runif(1,0,1),col=sample(c("blue","red"),size=1)) -} -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0,0.5) -xHeight=runif(10,0,1) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],0,xPres[i]+xWidth[i],xHeight[i],col=sample(c("blue","red"),size=1)) -rect(xPres[i]-0.1*xWidth[i],0,xPres[i]+0.1*xWidth[i],xHeight[i],col="gold") -} -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0,0.5) -xHeight=runif(10,0,1) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],0,xPres[i]+xWidth[i],xHeight[i],col=sample(c("blue","red"),size=1)) -rect(xPres[i]-0.2*xWidth[i],0,xPres[i]+0.2*xWidth[i],xHeight[i],col=sample("gold","silver")) -} -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0,0.5) -xHeight=runif(10,0,1) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],0,xPres[i]+xWidth[i],xHeight[i],col=sample(c("blue","red"),size=1)) -rect(xPres[i]-0.2*xWidth[i],0,xPres[i]+0.2*xWidth[i],xHeight[i],col=sample(c("gold","silver"),size=1) -} -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0,0.5) -xHeight=runif(10,0,1) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],0,xPres[i]+xWidth[i],xHeight[i],col=sample(c("blue","red"),size=1)) -rect(xPres[i]-0.2*xWidth[i],0,xPres[i]+0.2*xWidth[i],xHeight[i],col=sample(c("gold","silver"),size=1)) -} -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0,0.5) -xHeight=runif(10,0,1) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],0,xPres[i]+xWidth[i],xHeight[i],col=sample(c("blue","red"),size=1)) -rect(xPres[i]-0.2*xWidth[i],0,xPres[i]+0.2*xWidth[i],xHeight[i],col=sample(c("gold","grey87"),size=1)) -} -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0.1,0.5) -xHeight=runif(10,0,1) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],0,xPres[i]+xWidth[i],xHeight[i],col=sample(c("blue","red"),size=1)) -rect(xPres[i]-0.2*xWidth[i],0,xPres[i]+0.2*xWidth[i],xHeight[i],col=sample(c("gold","grey87"),size=1)) -} -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0.1,0.5) -xHeight=runif(10,0,1) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],0,xPres[i]+xWidth[i],xHeight[i],col=sample(c("blue","red"),size=1)) -rect(xPres[i]-0.2*xWidth[i],0,xPres[i]+0.2*xWidth[i],xHeight[i],col=sample(c("gold","grey87"),size=1)) -} -?png -png("xmas.png",height=2*480,width=480) - -# Make the canvas -plot(1:10,1:10,xlim=c(-5,5),ylim=c(0,10),type="n",xlab="",ylab="",xaxt="n",yaxt="n") -# Make the branches -rect(-1,0,1,2,col="tan3",border="tan4",lwd=3) -polygon(c(-5,0,5),c(2,4,2),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-4,0,4),c(3.5,5.5,3.5),col="palegreen4",border="palegreen3",lwd=3) -polygon(c(-3,0,3),c(5,6.5,5),col="palegreen3",border="palegreen4",lwd=3) -polygon(c(-2,0,2),c(6.25,7.5,6.25),col="palegreen4",border="palegreen3",lwd=3) -#Add some ornaments -points(x=runif(4,-5,5),y=rep(2,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-4,4),y=rep(3.5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-3,3),y=rep(5,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(x=runif(4,-2,2),y=rep(6.25,4),col=sample(c("blue","red"),size=4,replace=T),cex=3,pch=19) -points(0,7.5,pch=8,cex=5,col="gold",lwd=3) -# Add some presents -xPres = runif(10,-4.5,4.5) -xWidth = runif(10,0.1,0.5) -xHeight=runif(10,0,1) -for(i in 1:10){ -rect(xPres[i]-xWidth[i],0,xPres[i]+xWidth[i],xHeight[i],col=sample(c("blue","red"),size=1)) -rect(xPres[i]-0.2*xWidth[i],0,xPres[i]+0.2*xWidth[i],xHeight[i],col=sample(c("gold","grey87"),size=1)) -} -dev.off() -pvals = runif(10000) -pvals05 = pvals[pvals < 0.05] -hist(pvals05) -data() -?network -install.packages("ergm") -library(ergm) -?network -m <- matrix(rbinom(25,1,.4),5,5) -diag(m) <- 0 -g <- network(m, directed=FALSE) -summary(g) -m -ss = svd(M) -ss = svd(m) -plot(ss$v[,1]) -ss$u[,1] %*% t(ss$v[,1]) -ss$d[1]*ss$u[,1] %*% t(ss$v[,1]) -setwd("~/Dropbox/Jeff/teaching/2013/coursera/") -setwd("week1/001courseLogistics/") -slidify("index.Rmd") -library(slidify) -slidify("index.Rmd") -browseURL("index.html") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -setwd("../002gettingHelp/") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -setwd("../003whatIsData/") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -setwd("../004representingData/") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -setwd("../005representingDataR/") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -setwd("../006simulationBasics/") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -x = seq(0,5,length=6) -x -slidify("index.Rmd") -?dnorm -x = seq(0,10,by=1) -x -slidify("index.Rmd") -slidify("index.Rmd") -setwd("../007structureOfADataAnalysis/") -setwd("../") -slidify("index.Rmd") -setwd("007structureOfADataAnalysis1/") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -slidify("index.Rmd") -setwd("../008structureOfADataAnalysis2/") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -browseURL("index.html") -getwd() -setwd("~/Dropbox/Jeff/teaching/2013/coursera/week1/008structureOfADataAnalysis2/") -slidify("index.Rmd") -browseURL("index.html") -setwd("../007structureOfADataAnalysis1/") -slidify("index.Rmd") -browseURL("index.html") -setwd("../007typesOfQuestions/") -slidify("index.Rmd") -browseURL("index.html") -slidify("index.Rmd") -setwd("../008structureOfADataAnalysis1/") -slidify("index.Rmd") -browseURL("index.html") -setwd("../008sourcesOfDataSets/") -slidify("index.Rmd") -browseURL("index.Rmd") -browseURL("index.html") From 0e4df6fa674cd95aedfb38fd0c0cf12f6d11156a Mon Sep 17 00:00:00 2001 From: Ramnath Vaidyanathan Date: Tue, 22 Jan 2013 11:50:19 -0500 Subject: [PATCH 3/3] remove .DS_Store files --- .DS_Store | Bin 15364 -> 0 bytes 001courseLogistics/.DS_Store | Bin 6148 -> 0 bytes 001courseLogistics/assets/.DS_Store | Bin 6148 -> 0 bytes 001courseLogistics/libraries/.DS_Store | Bin 6148 -> 0 bytes .../libraries/frameworks/.DS_Store | Bin 6148 -> 0 bytes .../libraries/frameworks/io2012/.DS_Store | Bin 6148 -> 0 bytes .../frameworks/io2012/default/.DS_Store | Bin 6148 -> 0 bytes 002gettingHelp/.DS_Store | Bin 6148 -> 0 bytes 002gettingHelp/assets/.DS_Store | Bin 6148 -> 0 bytes 002gettingHelp/libraries/.DS_Store | Bin 6148 -> 0 bytes 002gettingHelp/libraries/frameworks/.DS_Store | Bin 6148 -> 0 bytes .../libraries/frameworks/io2012/.DS_Store | Bin 6148 -> 0 bytes .../frameworks/io2012/default/.DS_Store | Bin 6148 -> 0 bytes .../frameworks/io2012/default/js/.DS_Store | Bin 6148 -> 0 bytes 002gettingHelp/libraries/highlighters/.DS_Store | Bin 6148 -> 0 bytes .../highlighters/highlight.js/.DS_Store | Bin 12292 -> 0 bytes 003whatIsData/.DS_Store | Bin 6148 -> 0 bytes 003whatIsData/assets/.DS_Store | Bin 15364 -> 0 bytes 003whatIsData/assets/img/.DS_Store | Bin 6148 -> 0 bytes 003whatIsData/libraries/.DS_Store | Bin 6148 -> 0 bytes 003whatIsData/libraries/frameworks/.DS_Store | Bin 6148 -> 0 bytes .../libraries/frameworks/io2012/.DS_Store | Bin 6148 -> 0 bytes .../frameworks/io2012/default/.DS_Store | Bin 6148 -> 0 bytes .../frameworks/io2012/default/js/.DS_Store | Bin 6148 -> 0 bytes 003whatIsData/libraries/highlighters/.DS_Store | Bin 6148 -> 0 bytes .../highlighters/highlight.js/.DS_Store | Bin 12292 -> 0 bytes 004representingData/.DS_Store | Bin 6148 -> 0 bytes 004representingData/assets/.DS_Store | Bin 15364 -> 0 bytes 004representingData/assets/img/.DS_Store | Bin 6148 -> 0 bytes 004representingData/libraries/.DS_Store | Bin 6148 -> 0 bytes .../libraries/frameworks/.DS_Store | Bin 6148 -> 0 bytes .../libraries/frameworks/io2012/.DS_Store | Bin 6148 -> 0 bytes .../frameworks/io2012/default/.DS_Store | Bin 6148 -> 0 bytes .../frameworks/io2012/default/js/.DS_Store | Bin 6148 -> 0 bytes .../libraries/highlighters/.DS_Store | Bin 6148 -> 0 bytes .../highlighters/highlight.js/.DS_Store | Bin 12292 -> 0 bytes 005representingDataR/.DS_Store | Bin 6148 -> 0 bytes 005representingDataR/assets/.DS_Store | Bin 6148 -> 0 bytes 005representingDataR/libraries/.DS_Store | Bin 6148 -> 0 bytes .../libraries/frameworks/.DS_Store | Bin 6148 -> 0 bytes .../libraries/frameworks/io2012/.DS_Store | Bin 6148 -> 0 bytes .../frameworks/io2012/default/.DS_Store | Bin 6148 -> 0 bytes .../frameworks/io2012/default/js/.DS_Store | Bin 6148 -> 0 bytes .../libraries/highlighters/.DS_Store | Bin 6148 -> 0 bytes .../highlighters/highlight.js/.DS_Store | Bin 12292 -> 0 bytes 006simulationBasics/.DS_Store | Bin 6148 -> 0 bytes 006simulationBasics/assets/.DS_Store | Bin 6148 -> 0 bytes 006simulationBasics/libraries/.DS_Store | Bin 6148 -> 0 bytes .../libraries/frameworks/.DS_Store | Bin 6148 -> 0 bytes .../libraries/frameworks/io2012/.DS_Store | Bin 6148 -> 0 bytes .../frameworks/io2012/default/.DS_Store | Bin 6148 -> 0 bytes .../frameworks/io2012/default/js/.DS_Store | Bin 6148 -> 0 bytes .../libraries/highlighters/.DS_Store | Bin 6148 -> 0 bytes .../highlighters/highlight.js/.DS_Store | Bin 12292 -> 0 bytes 007typesOfQuestions/.DS_Store | Bin 6148 -> 0 bytes 007typesOfQuestions/assets/.DS_Store | Bin 15364 -> 0 bytes 007typesOfQuestions/assets/img/.DS_Store | Bin 6148 -> 0 bytes 007typesOfQuestions/libraries/.DS_Store | Bin 6148 -> 0 bytes .../libraries/frameworks/.DS_Store | Bin 6148 -> 0 bytes .../libraries/frameworks/io2012/.DS_Store | Bin 6148 -> 0 bytes .../frameworks/io2012/default/.DS_Store | Bin 6148 -> 0 bytes .../frameworks/io2012/default/js/.DS_Store | Bin 6148 -> 0 bytes .../libraries/highlighters/.DS_Store | Bin 6148 -> 0 bytes .../highlighters/highlight.js/.DS_Store | Bin 12292 -> 0 bytes 008sourcesOfDataSets/.DS_Store | Bin 6148 -> 0 bytes 008sourcesOfDataSets/assets/.DS_Store | Bin 15364 -> 0 bytes 008sourcesOfDataSets/assets/img/.DS_Store | Bin 6148 -> 0 bytes 008sourcesOfDataSets/libraries/.DS_Store | Bin 6148 -> 0 bytes .../libraries/frameworks/.DS_Store | Bin 6148 -> 0 bytes .../libraries/frameworks/io2012/.DS_Store | Bin 6148 -> 0 bytes .../frameworks/io2012/default/.DS_Store | Bin 6148 -> 0 bytes .../frameworks/io2012/default/js/.DS_Store | Bin 6148 -> 0 bytes .../libraries/highlighters/.DS_Store | Bin 6148 -> 0 bytes .../highlighters/highlight.js/.DS_Store | Bin 12292 -> 0 bytes 74 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .DS_Store delete mode 100644 001courseLogistics/.DS_Store delete mode 100644 001courseLogistics/assets/.DS_Store delete mode 100644 001courseLogistics/libraries/.DS_Store delete mode 100644 001courseLogistics/libraries/frameworks/.DS_Store delete mode 100644 001courseLogistics/libraries/frameworks/io2012/.DS_Store delete mode 100644 001courseLogistics/libraries/frameworks/io2012/default/.DS_Store delete mode 100644 002gettingHelp/.DS_Store delete mode 100644 002gettingHelp/assets/.DS_Store delete mode 100644 002gettingHelp/libraries/.DS_Store delete mode 100644 002gettingHelp/libraries/frameworks/.DS_Store delete mode 100644 002gettingHelp/libraries/frameworks/io2012/.DS_Store delete mode 100644 002gettingHelp/libraries/frameworks/io2012/default/.DS_Store delete mode 100644 002gettingHelp/libraries/frameworks/io2012/default/js/.DS_Store delete mode 100644 002gettingHelp/libraries/highlighters/.DS_Store delete mode 100644 002gettingHelp/libraries/highlighters/highlight.js/.DS_Store delete mode 100644 003whatIsData/.DS_Store delete mode 100644 003whatIsData/assets/.DS_Store delete mode 100644 003whatIsData/assets/img/.DS_Store delete mode 100644 003whatIsData/libraries/.DS_Store delete mode 100644 003whatIsData/libraries/frameworks/.DS_Store delete mode 100644 003whatIsData/libraries/frameworks/io2012/.DS_Store delete mode 100644 003whatIsData/libraries/frameworks/io2012/default/.DS_Store delete mode 100644 003whatIsData/libraries/frameworks/io2012/default/js/.DS_Store delete mode 100644 003whatIsData/libraries/highlighters/.DS_Store delete mode 100644 003whatIsData/libraries/highlighters/highlight.js/.DS_Store delete mode 100644 004representingData/.DS_Store delete mode 100644 004representingData/assets/.DS_Store delete mode 100644 004representingData/assets/img/.DS_Store delete mode 100644 004representingData/libraries/.DS_Store delete mode 100644 004representingData/libraries/frameworks/.DS_Store delete mode 100644 004representingData/libraries/frameworks/io2012/.DS_Store delete mode 100644 004representingData/libraries/frameworks/io2012/default/.DS_Store delete mode 100644 004representingData/libraries/frameworks/io2012/default/js/.DS_Store delete mode 100644 004representingData/libraries/highlighters/.DS_Store delete mode 100644 004representingData/libraries/highlighters/highlight.js/.DS_Store delete mode 100644 005representingDataR/.DS_Store delete mode 100644 005representingDataR/assets/.DS_Store delete mode 100644 005representingDataR/libraries/.DS_Store delete mode 100644 005representingDataR/libraries/frameworks/.DS_Store delete mode 100644 005representingDataR/libraries/frameworks/io2012/.DS_Store delete mode 100644 005representingDataR/libraries/frameworks/io2012/default/.DS_Store delete mode 100644 005representingDataR/libraries/frameworks/io2012/default/js/.DS_Store delete mode 100644 005representingDataR/libraries/highlighters/.DS_Store delete mode 100644 005representingDataR/libraries/highlighters/highlight.js/.DS_Store delete mode 100644 006simulationBasics/.DS_Store delete mode 100644 006simulationBasics/assets/.DS_Store delete mode 100644 006simulationBasics/libraries/.DS_Store delete mode 100644 006simulationBasics/libraries/frameworks/.DS_Store delete mode 100644 006simulationBasics/libraries/frameworks/io2012/.DS_Store delete mode 100644 006simulationBasics/libraries/frameworks/io2012/default/.DS_Store delete mode 100644 006simulationBasics/libraries/frameworks/io2012/default/js/.DS_Store delete mode 100644 006simulationBasics/libraries/highlighters/.DS_Store delete mode 100644 006simulationBasics/libraries/highlighters/highlight.js/.DS_Store delete mode 100644 007typesOfQuestions/.DS_Store delete mode 100644 007typesOfQuestions/assets/.DS_Store delete mode 100644 007typesOfQuestions/assets/img/.DS_Store delete mode 100644 007typesOfQuestions/libraries/.DS_Store delete mode 100644 007typesOfQuestions/libraries/frameworks/.DS_Store delete mode 100644 007typesOfQuestions/libraries/frameworks/io2012/.DS_Store delete mode 100644 007typesOfQuestions/libraries/frameworks/io2012/default/.DS_Store delete mode 100644 007typesOfQuestions/libraries/frameworks/io2012/default/js/.DS_Store delete mode 100644 007typesOfQuestions/libraries/highlighters/.DS_Store delete mode 100644 007typesOfQuestions/libraries/highlighters/highlight.js/.DS_Store delete mode 100644 008sourcesOfDataSets/.DS_Store delete mode 100644 008sourcesOfDataSets/assets/.DS_Store delete mode 100644 008sourcesOfDataSets/assets/img/.DS_Store delete mode 100644 008sourcesOfDataSets/libraries/.DS_Store delete mode 100644 008sourcesOfDataSets/libraries/frameworks/.DS_Store delete mode 100644 008sourcesOfDataSets/libraries/frameworks/io2012/.DS_Store delete mode 100644 008sourcesOfDataSets/libraries/frameworks/io2012/default/.DS_Store delete mode 100644 008sourcesOfDataSets/libraries/frameworks/io2012/default/js/.DS_Store delete mode 100644 008sourcesOfDataSets/libraries/highlighters/.DS_Store delete mode 100644 008sourcesOfDataSets/libraries/highlighters/highlight.js/.DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 5001877b20854b47737c0d2542c507175257d958..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15364 zcmeI1-EI;=6vxlDRhQTr;z!iGjaObYX3Ix`#0x@dQWFzDXwnO7bSYRi!CeB2#H=XQ z7w}2cOP|E&@qcEf#4eO#(_q`2AvH?Ck<&qpD3grb*M`XdNMX!I)s1_5CTF#2nd0*Kmb0Qi+xo~sfB;Z(eIdfWg~}LYIU+q z@L`#6woHU#sc*;g9W|Y-vX)W{0UfVazaa`9QC-9zzvNPFZXmXA>HQn%Lcwrj1h zhWS5g?Uvt-T=%!Nu()*T@)bLkvX^(Z{h%K9D`79FcVAYUVZZ9v8#S-|>UAq# zM~yu5q9#UEdn*iEXz!TW+kQQ2zE0nX<6>!j)yb4HgHxOmn{wkDceq^zuC9$ zJ$Sge<$WA{`aINDS>|M*6@5Rdzo0dfiSMhOpcMvtn9t9;rm$pyp#cbtAwYW*cP(n4 zZyZxiOJG=07_!u-CV9Z{7;9ofwY>R5$Y!%x6B+k3*2EOU5(sW61UaO(8q`)br?`UA znz#@+W;8N^=B7fEKMoDOnEzVI7jb4}Gx^h4D>Iv!z@wqAW6SvT4$0A$+BiNA+JGu( zbN_!iTu*Z&&1mFAGzDy;57<-An~z(D^ta#nJ_o;ZJB|xDVsdUtEt|Y@ zJ9*=FejT`-nEj4+Fh{zbeT-`|$J&@6qZeBd6m&j)cSOe=G*m@TbcoH*Ik34K$7`ih zi5+on+NNTk%+{kEN#`pDXSOrJM?G08As_^VfDjM@Lf}LM7PXec`Ts{p|NnoYXN!^$ z5CZ3efVH$y-KgMQ4>D-U*XCTigX;}0Efgc5S>j!u?0xEAbMPJj!^m;4jingNF0$;sRxR{mLp=xiYwb82NN*-0)7cx z`6c`w-pp>1jN5C4U?$pqoymhcvxclG-%aNTQ~gOh`?J={MMvd2R9Wb4TOxFXA3Tl`_zjby)I@ESsYP?kBg zQw3B3RiLkcUrB>|{UMF00;<4&t^ltO7L76T*gBM@1DzZJfczOL2A|IoTw^^(9$SYP zff-i{bfv~0F^nrm-1@x8W9!hBlaV`P9)D-!Pbfz2j<}U{GLb{=RRL9?tH6%C9P$4D z{O0q2w@9y40af6iQosyP=chAJ@_TEK9PhOj?JXJ`=d})hm%x#&7`eO^@1cnyZrK4w U9$SZq!1O~vWYA6(xK#yy0g<|f^Z)<= diff --git a/001courseLogistics/assets/.DS_Store b/001courseLogistics/assets/.DS_Store deleted file mode 100644 index 0895f6118757d040a9626837c0ceaa7c709381bb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK%}T>S5T0#goA?902t6*Ii$tSs1rH%q@F=vaD1i9hm)QXJ>YqFYIm>0Em)3oDY@F$W6r`twNZ1_7zzbs! zdvD%gAzC>U1B!va#sJ&9MYx6p5^wZ*|As-5n&vwx6t%TdSvL%Qv)2tGKOQ-87Wv6} zyC09*fq&zIJLDs0ZraBYZg=81M7t-WyMdqfFDupYxL&Wpg$IZsgLKskoGWIo)af@?xO4{OcG5SNKC_xoF`yV&bq3h^ zKv5am5_5t4=)i_Q0T4BGb3vQEC0GuXXiLlm;s^>6sfZ$#$R`F7>FB32&X$-96zM?t z$~cc)naCFk;j5#c@^B!wK-DS+6a%vi6h*hf?*EhT-~Y2os;3xG4E!qwh}LSi94txR ztqaAmyOyF}p)z4{xj>$Rjl7Pz!LH&eDi<81%s{jy<^s`!qJ9K84XRNL{3rt-+2*== diff --git a/001courseLogistics/libraries/.DS_Store b/001courseLogistics/libraries/.DS_Store deleted file mode 100644 index e6a1bb3765721f20be2f0b85d53e633da220e47c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKOH0E*5T3PFQyUZP;K!p~vXM928999-@qa z{-TN2z5}u4X84aVjQuz=Yx%}qVwo@oLd%f;(9ICmeX5%or zY!B4DJq-JSKfTg=?8mdn^QYQ#;l~5?XuYG<2=$(g?heCva9u1d7PV%rEbGa7DmbbTg&o{$7}dP@*Wi>}4Q zAbL=QNkufN!agyCNk_Z1ajwP0ph*XzXU1{t%<1Dr=-JUObvOvuAb*(wW?+?poaq+n z{6E8ACi9WMn!-J1fEoB_42XQI-SV&~d$xWnkIq_&?FJhO#U-SmpuTbmzz*#rCG9kR bNjk>4788Rs3fXl!B3}eFA^c$meu05c9OO%T diff --git a/001courseLogistics/libraries/frameworks/.DS_Store b/001courseLogistics/libraries/frameworks/.DS_Store deleted file mode 100644 index c188b1a6e8902d5269b3b8449a726511d1f3f4bc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK%}T>S5Z<-5rl^pM(BtB{NSfAq@eo1}Eg6{xHV4yAB78nT#<56p^FRAn0xk?dfDhF2@)!JJ@8)AWnmZ zf&QWkzrDjEmNJ`Jtp5EU!7`4r+_Jv-UaP&|IWW3i<7hsMk}%!4={gCsTW^tWyeNDO z{MDVbb3b2auD_Cz8$Vw_MB39djlrJl>{%4%i+i)T-P&WjFNT9r(HGl`bE_{#!*Nk` z4Wny*8Yib`m)BGOrFeZS6@MJ4mU67If_E@#OL_KINt`B6;IC?`TtZ@i7$63SfgNT* z9}33d4s$?DCkBXtW(IJ75TJ;T#!{i&I-tSpGsfG9C}87T0#RsmG?oe>0>V`(pep71 ziNRGl_=V1MG?ofgIpcC>7)Q@sJzlt+9sEM3Gwvv)mKY!g>I}40*TnPx3VxZ!M}ED8 zdc*)R@Xr|F?TI&WVNv>Q{joeeYX#^7C<^A4Xn=rSy97W7_mQ3qs<=QK@*It&LL3GC RvK){u0+JAFh=E^V;2TtqM@|3$ diff --git a/001courseLogistics/libraries/frameworks/io2012/.DS_Store b/001courseLogistics/libraries/frameworks/io2012/.DS_Store deleted file mode 100644 index 64b69abd294aa72f22771a01d3f17996f33bef4c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK%}T>S5T0$TCaBPhAf6V_Rr;gWgNINQJPH*&sAyu;7D7{+)E;6riVxtMh&P|a z=W%9t728_qMG>8W-EVewCd>CF>}CN#)Vh8NAP)c*Ho}aJ-4{ml)J800A~{4s&xqPy z5PCRz^4cTW9Qch2(7VgR8AK3yz0dD2Xhw0d_$o5l+|=}pW!u)=(LuB2hrL?ZZTZn* zy%F~6P5<0;JIBh8-MAao+>V;rbK?fiD1Sc;1N4tf_CeE+8z=e2Bq?u{3$jvL>lb8F zT`v~oT4kf(w=K)gzgP>)t6RJK?sfm>Hr2`r{K%Be8+?a*bPS2BdZ!hHtxJqh_6+!N z4j14;7XpYsQGE8=-%fEUNmfdgGLfuQ70Ie1xoJo~zLP|XcSHhhEXfC)9HKKsR@HOI z3a|pKzyu1I?bMo`AeU2E0aoCDDM0&!#75{COf{;l1G@|kX`X%~m7z~}35rRBj=@wT z&Y%fhil|G4xnc-ij&W)79D}JwT@FI6jL$JE3v)veYITfDl@7wu$UQ5-3JfZc)x$iU z|2yOF|AR$5Vg*=%Kc#@kZP&MJNXeY7Bjo6;mDon*))yvOMjHj{5ZM` zgUOY)i=de1-C&|U7eO%skGA_+mViB^=s_G6qibh>K0j=^?RG=CZfDU@^G>JPP{;1c zVqsgB?YvpL2S=yp{owJbe10(;C1BQRhqRJcFlZSM{v=JZ^d4HO=qiep2`~XBzyz28 z5TN71+F}|^fC(^xZv=3EP>@kQ($c8jI-tPoGy3bOn83!j1gawSNK2#Ofh0{=P}5b? z6GNKr(5@)XBQ1@Z?n3IBVH}#ddb~(IJG3huE~ICaOD4bsmI>5M)xq=s41SrFkNo8> zTw?-E;GYqY^`77B!lLMG{joeeYZc@h$e1v$L<17oOP2ts;6AdaoyM=whB%M3G>W5O SyY3Fk7Xb}~3nuUj1U>S5T0$TCaBPhptr?ym6mFY;30$x9)%Qou%ZbmHV~4Mr1nsv5nsroPvY}9 z`%`Iby^6|A*!?E6GYRu;*vS9@v!{Lwpbh{A4uKUDr!^wh#aNMww$u=rd`1STH%lj8 z7<((;WcZB?h`rkc7gD@NP~N{+ZxRM+)@;7BO0~AJxn-E9u`?V5ksr_OcpCZXwKI-q zPT-F`H@T5|=4R8>b`!aBY|qrv0S62u~3LBC`^SSs!*m|45q@-&b6PVu~4YOf$8Rh={Gaop)mP&d_I@% zz$}F{69dFRnSrXht&949@qPba4x&3^fEf5!46s_y>Dic)uB|J{iCW8X+~E)+{0fDi lA*jewjJ~22@8ghyb}ke|OJkuBEhzLOAZeh982C{JJ^+0hhsgi{ diff --git a/002gettingHelp/assets/.DS_Store b/002gettingHelp/assets/.DS_Store deleted file mode 100644 index a5027ca0258ec2476ed598fa8d006535dd4582fe..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK%}(1u5S~ra;`B$#r4rm$J*Sn4fl!Hq6@k=ar6A={s@AS6;>wMq*danDVBiJ% zCUESN^m#fnJCR6IZY|JiN80_yGdo^?pS4~u0I1G5S_fzVfP;;&_5{1%80D!gSw$k0 zRCJGQ7$#|mSJ&ZiX|xSk1*`%OO#xcFRrm}UWZ~rI`c2|2cio?=Qms9DyyDdB&a;DF zJc!asCmj!>?0vVNPP%dQB@9L%*w2G}oOOZ`XWj*QA2aOlr)h%zfsF3OQQrU9SSyNG zZ@l%U-e_-4o4ROky6Agb(`nst>Wv@HihYEgKe*VL_+%hcLTZCj{)pHVv@ZupRBw^F;nq>xyk zR)Mc`FYS(qwKkF1hP(YIh%to)S}Tx10LPHR81jFe-~yQis{H2fuani}JiWh1urpf) ztO5^I0s1~@Y=pjGX^=l1*zpknv4&wb^yw@?HCoUYEDd4?O_@?eQ>x^Mp-ef(wT$xx zOM|8y6wi$Jk(rg8P!!LOam~X)`37xo6|f4-D^N9;4cht@RSFy2SPLqS^3zh~kf@XgNSO(i!1@2UV EU!nB#ApigX diff --git a/002gettingHelp/libraries/.DS_Store b/002gettingHelp/libraries/.DS_Store deleted file mode 100644 index 2b852ca3daacc764ab2e4a1f0711709849ec773b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKO-sW-5S^`66RpsTpts;zrS+qw;31R>9)$`XtY|{24aTM8VpRsF!OK5`qu8z$(b{Fd`h1skqrNwkTr!vc!4poriXge4#M^= z{5&^DE%NCWW1uhr0};iuuf144*h9UCmEWj+YF*#zAM&M9GoTrmKL*tPX{^p)>AGUg zfM(za2KfG9K{?tAQ;A~hz#v)xAiqWmfz5jfo?|Jr6{Zs5fiRg0l&MU$7)+*P-coV4 z!c?M6C#ISYroPNnhr-0y@qSB$6SF1iQ8S}baA5GFvngPwgzhZ!8 zYxPS5Z-NTO;8~hL2toxm9*6s!9xfYJPIlFU_}!mHV~51r1nsv5nsroPvY}9 zv%5J2<5k4Y!0b0WKfBovvOkP5?ks~YV+LbP14ZO$)Cjt3Lk*RT$i*04*7H~C+>a8! zW}v_5!f$W0kR`0gELQ#gcYhv*X=YiUywPlJwYN20*LJ6qFbVyB$_;}D z-&@=YJM*$->Uawgx%RRdM1(y~k_han%ASNlHoG$p*X!f+ez#+u4hMP1To2DIu=|5N z*ELNyKD7O#lZ&gdmp{K0uaZCxTnpJ#Si&0^m9;#%i#ST+NAQ<5WiBBxKnxHA#K7h< zpw0wsXLBi_l@kNRzz+=I{$PS4+6oJaV(Wkgug@57A)KQQI<0Si`l_%igduyKg@r^M T1^uENkS+p(5Ne2lUtr)1_!>u# diff --git a/002gettingHelp/libraries/frameworks/io2012/.DS_Store b/002gettingHelp/libraries/frameworks/io2012/.DS_Store deleted file mode 100644 index 397ac06e493b02dc10e993ef22d2c200db101585..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKO-lnY5S_HuZvB8>1ib~%Ra&d91rJM6@F-O9U`2ObwUwnS-K|ARb;W~Me~L$c ziND90WCY#TgO~b229h_)WH!8)CTRdb)O%hDAP)c*7Q)O7R%49fR7NbtJror5jqu9# z0~cG*?$yX>(_s`a3j8(&Xz!-s6ha8y{>T06x5KDdd=;s5W@d zb-eJf(F*#Fws+<_-6Q2kPSgwQPFF?toT!Bnu?hgn=Vx*b30Two84 z&VmPLa1IXiz=vq^97~n8je=ZRFDs5!#c`84K7E&Cf=z;J3NC+Q6_H`BAj_4~m{olI zEdI!7~efp$IiQ zeqXBLAZ(4MHVPO8J}Z#c%{<-zJ72&5KPQ=%QNSqhuM`lO?Z$Q;De>JpLXPfQiRAOK6nfDj~ diff --git a/002gettingHelp/libraries/frameworks/io2012/default/.DS_Store b/002gettingHelp/libraries/frameworks/io2012/default/.DS_Store deleted file mode 100644 index 7f3dbc087e86674c99384c9eb719e9fbc2100016..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK%}T>S5Z-O8Ca92$ptr?ymDbjugNG0*cob6T!HOnEY$PP5N$sITBffx-;?wv% z&g^c*TD|ljT4rGOo1L9Wm@i>>hcU*TVNhqxVvHG}h$Rz-Zv@v-XQZS(6+n*9Nc(=2 z_%M6*`!mtx_=^nSw=1)2ma^0zeg1w?m}a%w8!weBOUo;UX&P(YP8bKt$VrBAke<7} zWaNgyjqeREq@8)$Fm=3vTsiZy9;`^aog@+1T^-#CgRFOHZH>qEgT4K#*l9NMsu&+0 z)~ce}ILdR=Fih*k*x24ZK5cvX!(;KJsN?XLNm zOfyhcQwz`klb`$l=_HyF1H`~WF~BP=x8*=d`fQyk4$oQvdIgGtafQN<6fopb46%3= cZ-Pnzzd!@f)>tS64+vcZBn>nW1Ha0^I}0&>$p8QV diff --git a/002gettingHelp/libraries/frameworks/io2012/default/js/.DS_Store b/002gettingHelp/libraries/frameworks/io2012/default/js/.DS_Store deleted file mode 100644 index 49e525c623f2216d3a576cc359869c7d339b8479..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK%}T>S5T3PFQ&i|h(A(m22ch73mc&zB}d4d>sm9xghI`cKmhmftu@^;4`Bit8JjR;grd_qsvoM^h)7g#P%t zJ&305!0&r*e53TlO(tWt_n z*{oJ%qkfjACCe(6->uz)qw~v-n?Ao}ubM=Gd@I>8IEOb>mg;$I$KfyvAJ8|?o5wRU z1Iz$3zznP&1LiESwpOonu9z8M27X|G_6LcL&^DN9R9gpjbbTg&k&py+dP@*WgSNp; zBYIGTPDRwI!aOmAPDi^makjxsqfQ5*R>pbE%JavIP^+U|s&EjtM(&vbW?+$lf*zLX z{J+4zOztCpF@;CW05kB<7!bu)yX9a}=4@RmkIq_&?G76W#buS5Z-O8CRm{tL2rxaQd(^l!9xfYJPIlFU_}!mO(Z0xN$sITBfgMFpTy^J zW_K%=+JhGnI|H-dWPY;jw_zvC7~}TDZ!uP5j2WPaB@>2k1mmbnQqmqoF5eNckPTVD zGS*niCdXf70Qas6JEr#S>;B!d)SIRwFG@VfdG$t7m}br9J1>Q8Kv=8f| z-8s$cVs_GLf_-$H=cZwpwKrq;pmBE5bMwci;#rZ&;k%Qvqj3%|V60r%gENk!BpyP} zynbFsNDL4I#K1Z*pwB*IdmR=_Ya|AUfgdq|=Ys%6v@{k9<(|#uCEwem4jdCJWFGtP?a+-XNLFanYq59a5+2pg-mDMQb;2)KnyH0 zP*#sM?EmMh@BfQM^h6901OJKvUg(b(|*9y>EP!!B76n>U~AzLxzVk_PQ al>&Z&2B4*}PzW9n`Vo*c&_E3QDgz(d%1n0v diff --git a/002gettingHelp/libraries/highlighters/highlight.js/.DS_Store b/002gettingHelp/libraries/highlighters/highlight.js/.DS_Store deleted file mode 100644 index 132bdd46613f1d35068aab965c19d4e0a9634658..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12292 zcmeHMPfQ&}9G>q1?XK*TftCssnrDfIRB9=uMJl!r3WZv=C{QR=>AtsXS-b4w+vU+n zXkXKtv8mBUO*EQbJk%z7uzx&w(StShCediD7h}BX#iZ4X{$^+CACQyA5S>Y8zM1*` ze)H$sZ{BA1F~-n2Wo>4xiZP~97RXDf_=_a$A}>mbxTly96wiXmjO%Bp^+9HGk+Cc=gQ8=GKmO|I9WZB)9WR`a3rBqTS#rTfPTtyu8|3@sSBS*<%%t4K zw>NijSE-S_yL)%f>Rw}vSL7Xgdf#N|_+GHz&IN>Hyey!7?aBIHU(OcxF-PD9BZfIJ9NI@i;j_pzJQDc1a90#K?9lkqi%$ji zQ#K9m&J9ir1`n7)*7hvN zJ3N$k0w?3z1D-iym!nbF=T?eSSE;h^#u^gLWr`Q|pEc=jMWS7`w_9^>jsi~L zMZAhLcnz=PUA&J=_!ytz3O>h|_zpkfXIz&{OUx_y(fL(N#0|pu9Fl_L?`VlLODK4E zPw$#N%UQwSlu6yLxu+@;^7fsbH?^?f@!u}PNO@9Pk>utj6)F2p9aq<^txc{oQcHe&E9W9_lDCi_*JQIHxk01j!4px_*qGcT#LtVQH4?R@^Ac%oHQK~M;KkC~ zZtM_}=PTxFYt~kmt}_febYc>tA=#~K9RGw)ud+GzL!{B)*&kR51Jzhh%51`Rq|t#c zQf3eO@Fe;%fc+T5A!Lw+O}g~)JaPyzi(`>KPvRw9ivuZ7828!h3s>J=jd+G20%XtfG zZHfWKz~5v5#a;bfoixZ&KjPx9ouYh*vPi&+ xrGNcHfO`L{_kW~3RVW4&1BwB~fMP%~pcqgLCdD1EG;5wTD=Z`UC!n9{m!( z$C=%&kXElEG81;+?Cj1i?^lZH|=AO^1D$KqJM5ip9X%~zpPZVY`fX2$;NhLT$5R= zRjJ zL5y@`^m>Jl_3anPu4UQAeq#$6wwj9Vu43CXY~LqriR`1M^&{Ko?-@;T){}6}3a|pK zz?1@JBej;M;@o5fSOHdm_6LcD&@q^6R9gpD>I#5Jzmdw&r@I8@NP~{STqE|N37v|l zQ-!%=2%U~`X~sDQbB#J3gjyNrF)IsmLlJ6qj7v2fgrkvbR)7^KDln&;6*~Wqe!l+~ zleonSumb-|0Z~5e9JY~?Ia_DQ(OE08Twx)jak<8?6m-;4jAQ92u3}M!aY+uMV=&i< Q5j6f0P%?1E3jC@9pTob0X#fBK diff --git a/003whatIsData/assets/.DS_Store b/003whatIsData/assets/.DS_Store deleted file mode 100644 index a48555f38855db62b0c487a8df8c135885797b6c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15364 zcmeHMZEO@p7@p@^U>9~_OD%1WkDN4t8jD_AN-Ge!UW-rxsrIlf6zbjW(k^Uo>+M|& zlxi`=s4)?v#*aTH#`uXbs2KlAG5r-NSN3P7@y zx<#S7!7C&qfs6%m!k46>0^gOS?~34x0pFeaBY|BkkQ2W2-5G+*2ZEUq+)yB9r|~1g zoFV2*`IZPs1TIB@-`z`Cnt9Aijb40zcWf^gjedntN$ITFa}-row7zaTW4fbpH=i-R z-Ccw3XqRnTsbqGKsOOToycbVqg{Cu^8zhaWCtTN|dS77OZJW8lej_|KwyM6Np`|Xe zx}|=+E;82K6s3COn(=W}QB>n?rDFLF>$fD5ci%H{^j?4E2zEcyiy}F8A&il(Y{qdj z1JuKy_OoD@!+b)##Tq0>mrTO=;cB?GETwKBB@Lp8V@}P!tq8r{R~U! zL?MVX=fBY0d73_d)6JVJwT>P;?Pj{{!&bksz@zWfLCwyrHDX(%{YF_j>7?^cGH10q z4ma|;)2@>r%6Qy5opl|j)Aj6}?Phv=a@N6IVW26ho?V`s&9w=~e#6Ln*6kLJX^&X# zG%^jfkk7Vbm=ELKVP!p%HL<9Om8r_h3#yi0yW;w2(@h&Djk1O1T7_2GJz{%y%CUBi za)$IKy|k4v?aaU~Vp%3<@3XC}T826`kx33&ljUU#jq0$j^_eu^cGu*3(>SH5LbEKa z>$|z8Eo;%+R20#@yhhg&9>r`V1H+ZInwB^~#5O$Dcdc8c={ucd%5n@-_1)?lG`)Mo z55m|Qbgrq;^q#akG(?N@g1)uubbT+Mc3aZR?HIN)w4{${?v1h5ay_iKPZy%1^m4CO z)3nT**ajb^npka6@daZloo)(S%2u!zwv8p&KIXEc>>>6Hdy~DxPP2E}$Lve?4f~$` z#Llu`+3)Ne7*s4m6{-nDFHG#i00wav4q*&OFpm51 zFplF9JdKy|3QpivyoJ;F5TD{Re2z2t0YBpxob{I%Ds0YM3d{8+ej|B-!9k8N^w=~E z-n^w_kru!58T|DE&f9A$7FAXWBCp-pcAgDI6u6j(f_*-{1nmm65~QBO<;m*s;w4L$ z5gCb{*1_UkQJ|7BhwlkRSQEWME z!}E9nFXAL##~V0Be0>k^;{$wxNqk$x)U8EK{q6!&i;j^H+dt)m{Fe@qhNeb36QeES z5NQ_YV@q&89xt4afAH1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T09)$`XtY|{24aTM8VpRsF!OK5`qu8z$(b{Fd`h1skqrNwkTr!vc!4poriXge4#M^= z{5&^DE%NCWW1uhr0};iuuf144*h9UCmEWj+YF*#zAM&M9GoTrmKL*tPX{^p)>AGUg zfM(za2KfG9K{?tAQ;A~hz#v)xAiqWmfz5jfo?|Jr6{Zs5fiRg0l&MU$7)+*P-coV4 z!c?M6C#ISYroPNnhr-0y@qSB$6SF1iQ8S}baA5GFvngPwgzhZ!8 zYxPS5Z-NTO;8~hL2toxm9*6s!9xfYJPIlFU_}!mHV~51r1nsv5nsroPvY}9 zv%5J2<5k4Y!0b0WKfBovvOkP5?ks~YV+LbP14ZO$)Cjt3Lk*RT$i*04*7H~C+>a8! zW}v_5!f$W0kR`0gELQ#gcYhv*X=YiUywPlJwYN20*LJ6qFbVyB$_;}D z-&@=YJM*$->Uawgx%RRdM1(y~k_han%ASNlHoG$p*X!f+ez#+u4hMP1To2DIu=|5N z*ELNyKD7O#lZ&gdmp{K0uaZCxTnpJ#Si&0^m9;#%i#ST+NAQ<5WiBBxKnxHA#K7h< zpw0wsXLBi_l@kNRzz+=I{$PS4+6oJaV(Wkgug@57A)KQQI<0Si`l_%igduyKg@r^M T1^uENkS+p(5Ne2lUtr)1_!>u# diff --git a/003whatIsData/libraries/frameworks/io2012/.DS_Store b/003whatIsData/libraries/frameworks/io2012/.DS_Store deleted file mode 100644 index 397ac06e493b02dc10e993ef22d2c200db101585..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKO-lnY5S_HuZvB8>1ib~%Ra&d91rJM6@F-O9U`2ObwUwnS-K|ARb;W~Me~L$c ziND90WCY#TgO~b229h_)WH!8)CTRdb)O%hDAP)c*7Q)O7R%49fR7NbtJror5jqu9# z0~cG*?$yX>(_s`a3j8(&Xz!-s6ha8y{>T06x5KDdd=;s5W@d zb-eJf(F*#Fws+<_-6Q2kPSgwQPFF?toT!Bnu?hgn=Vx*b30Two84 z&VmPLa1IXiz=vq^97~n8je=ZRFDs5!#c`84K7E&Cf=z;J3NC+Q6_H`BAj_4~m{olI zEdI!7~efp$IiQ zeqXBLAZ(4MHVPO8J}Z#c%{<-zJ72&5KPQ=%QNSqhuM`lO?Z$Q;De>JpLXPfQiRAOK6nfDj~ diff --git a/003whatIsData/libraries/frameworks/io2012/default/.DS_Store b/003whatIsData/libraries/frameworks/io2012/default/.DS_Store deleted file mode 100644 index 7f3dbc087e86674c99384c9eb719e9fbc2100016..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK%}T>S5Z-O8Ca92$ptr?ymDbjugNG0*cob6T!HOnEY$PP5N$sITBffx-;?wv% z&g^c*TD|ljT4rGOo1L9Wm@i>>hcU*TVNhqxVvHG}h$Rz-Zv@v-XQZS(6+n*9Nc(=2 z_%M6*`!mtx_=^nSw=1)2ma^0zeg1w?m}a%w8!weBOUo;UX&P(YP8bKt$VrBAke<7} zWaNgyjqeREq@8)$Fm=3vTsiZy9;`^aog@+1T^-#CgRFOHZH>qEgT4K#*l9NMsu&+0 z)~ce}ILdR=Fih*k*x24ZK5cvX!(;KJsN?XLNm zOfyhcQwz`klb`$l=_HyF1H`~WF~BP=x8*=d`fQyk4$oQvdIgGtafQN<6fopb46%3= cZ-Pnzzd!@f)>tS64+vcZBn>nW1Ha0^I}0&>$p8QV diff --git a/003whatIsData/libraries/frameworks/io2012/default/js/.DS_Store b/003whatIsData/libraries/frameworks/io2012/default/js/.DS_Store deleted file mode 100644 index 49e525c623f2216d3a576cc359869c7d339b8479..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK%}T>S5T3PFQ&i|h(A(m22ch73mc&zB}d4d>sm9xghI`cKmhmftu@^;4`Bit8JjR;grd_qsvoM^h)7g#P%t zJ&305!0&r*e53TlO(tWt_n z*{oJ%qkfjACCe(6->uz)qw~v-n?Ao}ubM=Gd@I>8IEOb>mg;$I$KfyvAJ8|?o5wRU z1Iz$3zznP&1LiESwpOonu9z8M27X|G_6LcL&^DN9R9gpjbbTg&k&py+dP@*WgSNp; zBYIGTPDRwI!aOmAPDi^makjxsqfQ5*R>pbE%JavIP^+U|s&EjtM(&vbW?+$lf*zLX z{J+4zOztCpF@;CW05kB<7!bu)yX9a}=4@RmkIq_&?G76W#buS5Z-O8CRm{tL2rxaQd(^l!9xfYJPIlFU_}!mO(Z0xN$sITBfgMFpTy^J zW_K%=+JhGnI|H-dWPY;jw_zvC7~}TDZ!uP5j2WPaB@>2k1mmbnQqmqoF5eNckPTVD zGS*niCdXf70Qas6JEr#S>;B!d)SIRwFG@VfdG$t7m}br9J1>Q8Kv=8f| z-8s$cVs_GLf_-$H=cZwpwKrq;pmBE5bMwci;#rZ&;k%Qvqj3%|V60r%gENk!BpyP} zynbFsNDL4I#K1Z*pwB*IdmR=_Ya|AUfgdq|=Ys%6v@{k9<(|#uCEwem4jdCJWFGtP?a+-XNLFanYq59a5+2pg-mDMQb;2)KnyH0 zP*#sM?EmMh@BfQM^h6901OJKvUg(b(|*9y>EP!!B76n>U~AzLxzVk_PQ al>&Z&2B4*}PzW9n`Vo*c&_E3QDgz(d%1n0v diff --git a/003whatIsData/libraries/highlighters/highlight.js/.DS_Store b/003whatIsData/libraries/highlighters/highlight.js/.DS_Store deleted file mode 100644 index 132bdd46613f1d35068aab965c19d4e0a9634658..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12292 zcmeHMPfQ&}9G>q1?XK*TftCssnrDfIRB9=uMJl!r3WZv=C{QR=>AtsXS-b4w+vU+n zXkXKtv8mBUO*EQbJk%z7uzx&w(StShCediD7h}BX#iZ4X{$^+CACQyA5S>Y8zM1*` ze)H$sZ{BA1F~-n2Wo>4xiZP~97RXDf_=_a$A}>mbxTly96wiXmjO%Bp^+9HGk+Cc=gQ8=GKmO|I9WZB)9WR`a3rBqTS#rTfPTtyu8|3@sSBS*<%%t4K zw>NijSE-S_yL)%f>Rw}vSL7Xgdf#N|_+GHz&IN>Hyey!7?aBIHU(OcxF-PD9BZfIJ9NI@i;j_pzJQDc1a90#K?9lkqi%$ji zQ#K9m&J9ir1`n7)*7hvN zJ3N$k0w?3z1D-iym!nbF=T?eSSE;h^#u^gLWr`Q|pEc=jMWS7`w_9^>jsi~L zMZAhLcnz=PUA&J=_!ytz3O>h|_zpkfXIz&{OUx_y(fL(N#0|pu9Fl_L?`VlLODK4E zPw$#N%UQwSlu6yLxu+@;^7fsbH?^?f@!u}PNO@9Pk>utj6)F2p9aq<^txc{oQcHe&E9W9_lDCi_*JQIHxk01j!4px_*qGcT#LtVQH4?R@^Ac%oHQK~M;KkC~ zZtM_}=PTxFYt~kmt}_febYc>tA=#~K9RGw)ud+GzL!{B)*&kR51Jzhh%51`Rq|t#c zQf3eO@Fe;%fc+T5A!Lw+O}g~)JaPyzi(`>KPvRw9ivuZ7828!h3s>J=jd+G20%XtfG zZHfWKz~5v5#a;bfoixZ&KjPx9ouYh*vPi&+ xrGNcHfO`L{_kW~3RVW4&1BwB~fMP%~pcqgLCP8`{a%eDVc<_Oz;b)Fy(&`Dck4)U;;!Y;GpGkE& j(CF(}8saKmgi1jl7Y5MLm??w@V*Ut78cbst7%Ky>*9pR? diff --git a/004representingData/assets/.DS_Store b/004representingData/assets/.DS_Store deleted file mode 100644 index 734fb8d10b1063656ecebea2a605fb418f141e7c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15364 zcmeI1U2GIp6vyv5EiePSbf6ZxNXbGC6fLkVlrDl{TS_QWXr(RNFIZ-G2N;;{)SYdM zlwu)Gj6#$LVwCvtfG-*nLj*%&_%QLo@L-H?NJOJ(j33d&@FMZ!!EB9+?LSInM@X_KC}Abh8d^3 zQ}MpryhVl}AP5Kof`A|(2;2<>=r@}uX^LaTSr8Be1c4g_`1lZ{gWHH}M;vPp9dxpn z0Avd(+fHaqWm>o$3tS#Rs@g26u%5 z_S32TpzY2e;#hGO1O$QG3GlUh0ZTB8S@FSJ*YAdIWkR9LfCYsUCQg!MS@QKn^;FUv ztT+2pNvpecmpRy~C$+em-fCZG)J(rsucqyi7B#brO6==4(=_P1$Muft$;_^pGHYmP zQB`$yxH7mbTs2%79ICAe(e={h!^5&9$;w%&WZvRcjcw|Ir$-JRa^4(V^)r87B%?RO z7-&tW3^TQpa=3Q^(^)Uuc}s9_$NTPhaHT^-)io&}uT)FXuCQtGCr*7RAo9RXMvH0b8Qn~Ec4V}@nOs9-iaNS1Go4vuSBxo2zol)~ zs7-x9YoL~?spXJ9udybr(K#te+2V?Y4?j}r{eU)$*eNP+I8;@=beYfd zRoeEDa1=`>&+v*zSFZATzCyd9#x+Ap%Jle1UHzH{Z`bI616A3;og3FbzM;h1xg%lr z_7X&k`!=^cvANY7!#0kgNwqS~eOijpeMl^#9i7GgGJj7FZazXu>g2WRl1VLD9%;X5 zf9CQ?h4Z<~9mAMRzs?dXWAj;`E4T_j!Y}X}0?IfAedxy-I2-5VVywk5uE2V1#Ld`+I_^OOdvO2{ z;3z(iFW^x;jwkRWp22sWa4`DA(r*9>ha<7?0trdCE-WDf6|P%FLT4Alp4=2K2v85|+}OClt2lKehJ!C+yCD zj^^e+|8|mKhmaT6BxW#`Jw?N8Kg-Qv9JPS)AYzvF)fi1q(}-?0H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T09)$`XtY|{24aTM8VpRsF!OK5`qu8z$(b{Fd`h1skqrNwkTr!vc!4poriXge4#M^= z{5&^DE%NCWW1uhr0};iuuf144*h9UCmEWj+YF*#zAM&M9GoTrmKL*tPX{^p)>AGUg zfM(za2KfG9K{?tAQ;A~hz#v)xAiqWmfz5jfo?|Jr6{Zs5fiRg0l&MU$7)+*P-coV4 z!c?M6C#ISYroPNnhr-0y@qSB$6SF1iQ8S}baA5GFvngPwgzhZ!8 zYxPS5Z-NTO;8~hL2toxm9*6s!9xfYJPIlFU_}!mHV~51r1nsv5nsroPvY}9 zv%5J2<5k4Y!0b0WKfBovvOkP5?ks~YV+LbP14ZO$)Cjt3Lk*RT$i*04*7H~C+>a8! zW}v_5!f$W0kR`0gELQ#gcYhv*X=YiUywPlJwYN20*LJ6qFbVyB$_;}D z-&@=YJM*$->Uawgx%RRdM1(y~k_han%ASNlHoG$p*X!f+ez#+u4hMP1To2DIu=|5N z*ELNyKD7O#lZ&gdmp{K0uaZCxTnpJ#Si&0^m9;#%i#ST+NAQ<5WiBBxKnxHA#K7h< zpw0wsXLBi_l@kNRzz+=I{$PS4+6oJaV(Wkgug@57A)KQQI<0Si`l_%igduyKg@r^M T1^uENkS+p(5Ne2lUtr)1_!>u# diff --git a/004representingData/libraries/frameworks/io2012/.DS_Store b/004representingData/libraries/frameworks/io2012/.DS_Store deleted file mode 100644 index 397ac06e493b02dc10e993ef22d2c200db101585..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKO-lnY5S_HuZvB8>1ib~%Ra&d91rJM6@F-O9U`2ObwUwnS-K|ARb;W~Me~L$c ziND90WCY#TgO~b229h_)WH!8)CTRdb)O%hDAP)c*7Q)O7R%49fR7NbtJror5jqu9# z0~cG*?$yX>(_s`a3j8(&Xz!-s6ha8y{>T06x5KDdd=;s5W@d zb-eJf(F*#Fws+<_-6Q2kPSgwQPFF?toT!Bnu?hgn=Vx*b30Two84 z&VmPLa1IXiz=vq^97~n8je=ZRFDs5!#c`84K7E&Cf=z;J3NC+Q6_H`BAj_4~m{olI zEdI!7~efp$IiQ zeqXBLAZ(4MHVPO8J}Z#c%{<-zJ72&5KPQ=%QNSqhuM`lO?Z$Q;De>JpLXPfQiRAOK6nfDj~ diff --git a/004representingData/libraries/frameworks/io2012/default/.DS_Store b/004representingData/libraries/frameworks/io2012/default/.DS_Store deleted file mode 100644 index 7f3dbc087e86674c99384c9eb719e9fbc2100016..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK%}T>S5Z-O8Ca92$ptr?ymDbjugNG0*cob6T!HOnEY$PP5N$sITBffx-;?wv% z&g^c*TD|ljT4rGOo1L9Wm@i>>hcU*TVNhqxVvHG}h$Rz-Zv@v-XQZS(6+n*9Nc(=2 z_%M6*`!mtx_=^nSw=1)2ma^0zeg1w?m}a%w8!weBOUo;UX&P(YP8bKt$VrBAke<7} zWaNgyjqeREq@8)$Fm=3vTsiZy9;`^aog@+1T^-#CgRFOHZH>qEgT4K#*l9NMsu&+0 z)~ce}ILdR=Fih*k*x24ZK5cvX!(;KJsN?XLNm zOfyhcQwz`klb`$l=_HyF1H`~WF~BP=x8*=d`fQyk4$oQvdIgGtafQN<6fopb46%3= cZ-Pnzzd!@f)>tS64+vcZBn>nW1Ha0^I}0&>$p8QV diff --git a/004representingData/libraries/frameworks/io2012/default/js/.DS_Store b/004representingData/libraries/frameworks/io2012/default/js/.DS_Store deleted file mode 100644 index 49e525c623f2216d3a576cc359869c7d339b8479..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK%}T>S5T3PFQ&i|h(A(m22ch73mc&zB}d4d>sm9xghI`cKmhmftu@^;4`Bit8JjR;grd_qsvoM^h)7g#P%t zJ&305!0&r*e53TlO(tWt_n z*{oJ%qkfjACCe(6->uz)qw~v-n?Ao}ubM=Gd@I>8IEOb>mg;$I$KfyvAJ8|?o5wRU z1Iz$3zznP&1LiESwpOonu9z8M27X|G_6LcL&^DN9R9gpjbbTg&k&py+dP@*WgSNp; zBYIGTPDRwI!aOmAPDi^makjxsqfQ5*R>pbE%JavIP^+U|s&EjtM(&vbW?+$lf*zLX z{J+4zOztCpF@;CW05kB<7!bu)yX9a}=4@RmkIq_&?G76W#buS5Z-O8CRm{tL2rxaQd(^l!9xfYJPIlFU_}!mO(Z0xN$sITBfgMFpTy^J zW_K%=+JhGnI|H-dWPY;jw_zvC7~}TDZ!uP5j2WPaB@>2k1mmbnQqmqoF5eNckPTVD zGS*niCdXf70Qas6JEr#S>;B!d)SIRwFG@VfdG$t7m}br9J1>Q8Kv=8f| z-8s$cVs_GLf_-$H=cZwpwKrq;pmBE5bMwci;#rZ&;k%Qvqj3%|V60r%gENk!BpyP} zynbFsNDL4I#K1Z*pwB*IdmR=_Ya|AUfgdq|=Ys%6v@{k9<(|#uCEwem4jdCJWFGtP?a+-XNLFanYq59a5+2pg-mDMQb;2)KnyH0 zP*#sM?EmMh@BfQM^h6901OJKvUg(b(|*9y>EP!!B76n>U~AzLxzVk_PQ al>&Z&2B4*}PzW9n`Vo*c&_E3QDgz(d%1n0v diff --git a/004representingData/libraries/highlighters/highlight.js/.DS_Store b/004representingData/libraries/highlighters/highlight.js/.DS_Store deleted file mode 100644 index 132bdd46613f1d35068aab965c19d4e0a9634658..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12292 zcmeHMPfQ&}9G>q1?XK*TftCssnrDfIRB9=uMJl!r3WZv=C{QR=>AtsXS-b4w+vU+n zXkXKtv8mBUO*EQbJk%z7uzx&w(StShCediD7h}BX#iZ4X{$^+CACQyA5S>Y8zM1*` ze)H$sZ{BA1F~-n2Wo>4xiZP~97RXDf_=_a$A}>mbxTly96wiXmjO%Bp^+9HGk+Cc=gQ8=GKmO|I9WZB)9WR`a3rBqTS#rTfPTtyu8|3@sSBS*<%%t4K zw>NijSE-S_yL)%f>Rw}vSL7Xgdf#N|_+GHz&IN>Hyey!7?aBIHU(OcxF-PD9BZfIJ9NI@i;j_pzJQDc1a90#K?9lkqi%$ji zQ#K9m&J9ir1`n7)*7hvN zJ3N$k0w?3z1D-iym!nbF=T?eSSE;h^#u^gLWr`Q|pEc=jMWS7`w_9^>jsi~L zMZAhLcnz=PUA&J=_!ytz3O>h|_zpkfXIz&{OUx_y(fL(N#0|pu9Fl_L?`VlLODK4E zPw$#N%UQwSlu6yLxu+@;^7fsbH?^?f@!u}PNO@9Pk>utj6)F2p9aq<^txc{oQcHe&E9W9_lDCi_*JQIHxk01j!4px_*qGcT#LtVQH4?R@^Ac%oHQK~M;KkC~ zZtM_}=PTxFYt~kmt}_febYc>tA=#~K9RGw)ud+GzL!{B)*&kR51Jzhh%51`Rq|t#c zQf3eO@Fe;%fc+T5A!Lw+O}g~)JaPyzi(`>KPvRw9ivuZ7828!h3s>J=jd+G20%XtfG zZHfWKz~5v5#a;bfoixZ&KjPx9ouYh*vPi&+ xrGNcHfO`L{_kW~3RVW4&1BwB~fMP%~pcqgLCZ|xr)2Y+W5mzB{^;ZxJLX7L%W;nb-78D!%m9iJi2 zIW8p>Q%D);X7Gl!kM;fy$ZnM7mv5bIFzoGWwq4D3*Rp+hX3J!+46Rq$-n`6cjPD-zgdF;x{-cXcY9dS<&C*>QIS`-ik>Iy8GW{c1N z!`JWs^(1MD0;0fwrGRQ43=aCBWY5+Ga(vc$D8EtIcwA-hUkV(36k{wO#p@{A5ck*t V`W7pLh`{7WK+7PNDDb8VJORVKhiL!+ diff --git a/005representingDataR/assets/.DS_Store b/005representingDataR/assets/.DS_Store deleted file mode 100644 index b312975ba9a541d07580ba60c94f588e718e0d6e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKO>fgc5S>i|b@-5SK`J+kb3tiCnjmqoq9SobN~Ins0vn^o$iz|X5FwM+z#rhB zz>#0V@8QktRB94>gSMa@Y4?q1cD#OXWv`cr%wQI86SauQLt|{*K=&KtJhwHgX@rx8 z?~zZUG>dTcJ({eIb^)h=Q{bv8!0&FIUQTGZM4|}_dEx+t_+weQPi$&A(nynw+oqG=+Kiv-($0yY%E1SVrM(noYDSUyWEZz^N z<1`x|A;P2Ul+ZgmI>YT-H2Le?Hp{Zx2c6DNSE%)bT3@MsJ*D=Mx#1yU=TiHOq>@;n zR-?B|i*`Z8cDfy`Q@j5shzW%iS{sy7NFOMp85RFJ!4)zqRAuEauhX~5yLow!;AVCT zI0de#0{ngO(HH~8%A$Na(8&=1*g#keKA$DH##am!D~rg$j4cJ)Qlm!W5SaiKpz$vh-K;2%pc>jNL{`r5o$Xz)FoC5!q0;aJy z+#7(B?yYO&c(3)*UZJt^xXPlGpwsPG9NvmI(ZrDR*#QQMl|@8g?ngjmaGg`&LKXN0 DTpaT& diff --git a/005representingDataR/libraries/.DS_Store b/005representingDataR/libraries/.DS_Store deleted file mode 100644 index 2b852ca3daacc764ab2e4a1f0711709849ec773b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKO-sW-5S^`66RpsTpts;zrS+qw;31R>9)$`XtY|{24aTM8VpRsF!OK5`qu8z$(b{Fd`h1skqrNwkTr!vc!4poriXge4#M^= z{5&^DE%NCWW1uhr0};iuuf144*h9UCmEWj+YF*#zAM&M9GoTrmKL*tPX{^p)>AGUg zfM(za2KfG9K{?tAQ;A~hz#v)xAiqWmfz5jfo?|Jr6{Zs5fiRg0l&MU$7)+*P-coV4 z!c?M6C#ISYroPNnhr-0y@qSB$6SF1iQ8S}baA5GFvngPwgzhZ!8 zYxPS5Z-NTO;8~hL2toxm9*6s!9xfYJPIlFU_}!mHV~51r1nsv5nsroPvY}9 zv%5J2<5k4Y!0b0WKfBovvOkP5?ks~YV+LbP14ZO$)Cjt3Lk*RT$i*04*7H~C+>a8! zW}v_5!f$W0kR`0gELQ#gcYhv*X=YiUywPlJwYN20*LJ6qFbVyB$_;}D z-&@=YJM*$->Uawgx%RRdM1(y~k_han%ASNlHoG$p*X!f+ez#+u4hMP1To2DIu=|5N z*ELNyKD7O#lZ&gdmp{K0uaZCxTnpJ#Si&0^m9;#%i#ST+NAQ<5WiBBxKnxHA#K7h< zpw0wsXLBi_l@kNRzz+=I{$PS4+6oJaV(Wkgug@57A)KQQI<0Si`l_%igduyKg@r^M T1^uENkS+p(5Ne2lUtr)1_!>u# diff --git a/005representingDataR/libraries/frameworks/io2012/.DS_Store b/005representingDataR/libraries/frameworks/io2012/.DS_Store deleted file mode 100644 index 397ac06e493b02dc10e993ef22d2c200db101585..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKO-lnY5S_HuZvB8>1ib~%Ra&d91rJM6@F-O9U`2ObwUwnS-K|ARb;W~Me~L$c ziND90WCY#TgO~b229h_)WH!8)CTRdb)O%hDAP)c*7Q)O7R%49fR7NbtJror5jqu9# z0~cG*?$yX>(_s`a3j8(&Xz!-s6ha8y{>T06x5KDdd=;s5W@d zb-eJf(F*#Fws+<_-6Q2kPSgwQPFF?toT!Bnu?hgn=Vx*b30Two84 z&VmPLa1IXiz=vq^97~n8je=ZRFDs5!#c`84K7E&Cf=z;J3NC+Q6_H`BAj_4~m{olI zEdI!7~efp$IiQ zeqXBLAZ(4MHVPO8J}Z#c%{<-zJ72&5KPQ=%QNSqhuM`lO?Z$Q;De>JpLXPfQiRAOK6nfDj~ diff --git a/005representingDataR/libraries/frameworks/io2012/default/.DS_Store b/005representingDataR/libraries/frameworks/io2012/default/.DS_Store deleted file mode 100644 index 7f3dbc087e86674c99384c9eb719e9fbc2100016..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK%}T>S5Z-O8Ca92$ptr?ymDbjugNG0*cob6T!HOnEY$PP5N$sITBffx-;?wv% z&g^c*TD|ljT4rGOo1L9Wm@i>>hcU*TVNhqxVvHG}h$Rz-Zv@v-XQZS(6+n*9Nc(=2 z_%M6*`!mtx_=^nSw=1)2ma^0zeg1w?m}a%w8!weBOUo;UX&P(YP8bKt$VrBAke<7} zWaNgyjqeREq@8)$Fm=3vTsiZy9;`^aog@+1T^-#CgRFOHZH>qEgT4K#*l9NMsu&+0 z)~ce}ILdR=Fih*k*x24ZK5cvX!(;KJsN?XLNm zOfyhcQwz`klb`$l=_HyF1H`~WF~BP=x8*=d`fQyk4$oQvdIgGtafQN<6fopb46%3= cZ-Pnzzd!@f)>tS64+vcZBn>nW1Ha0^I}0&>$p8QV diff --git a/005representingDataR/libraries/frameworks/io2012/default/js/.DS_Store b/005representingDataR/libraries/frameworks/io2012/default/js/.DS_Store deleted file mode 100644 index 49e525c623f2216d3a576cc359869c7d339b8479..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK%}T>S5T3PFQ&i|h(A(m22ch73mc&zB}d4d>sm9xghI`cKmhmftu@^;4`Bit8JjR;grd_qsvoM^h)7g#P%t zJ&305!0&r*e53TlO(tWt_n z*{oJ%qkfjACCe(6->uz)qw~v-n?Ao}ubM=Gd@I>8IEOb>mg;$I$KfyvAJ8|?o5wRU z1Iz$3zznP&1LiESwpOonu9z8M27X|G_6LcL&^DN9R9gpjbbTg&k&py+dP@*WgSNp; zBYIGTPDRwI!aOmAPDi^makjxsqfQ5*R>pbE%JavIP^+U|s&EjtM(&vbW?+$lf*zLX z{J+4zOztCpF@;CW05kB<7!bu)yX9a}=4@RmkIq_&?G76W#buS5Z-O8CRm{tL2rxaQd(^l!9xfYJPIlFU_}!mO(Z0xN$sITBfgMFpTy^J zW_K%=+JhGnI|H-dWPY;jw_zvC7~}TDZ!uP5j2WPaB@>2k1mmbnQqmqoF5eNckPTVD zGS*niCdXf70Qas6JEr#S>;B!d)SIRwFG@VfdG$t7m}br9J1>Q8Kv=8f| z-8s$cVs_GLf_-$H=cZwpwKrq;pmBE5bMwci;#rZ&;k%Qvqj3%|V60r%gENk!BpyP} zynbFsNDL4I#K1Z*pwB*IdmR=_Ya|AUfgdq|=Ys%6v@{k9<(|#uCEwem4jdCJWFGtP?a+-XNLFanYq59a5+2pg-mDMQb;2)KnyH0 zP*#sM?EmMh@BfQM^h6901OJKvUg(b(|*9y>EP!!B76n>U~AzLxzVk_PQ al>&Z&2B4*}PzW9n`Vo*c&_E3QDgz(d%1n0v diff --git a/005representingDataR/libraries/highlighters/highlight.js/.DS_Store b/005representingDataR/libraries/highlighters/highlight.js/.DS_Store deleted file mode 100644 index 132bdd46613f1d35068aab965c19d4e0a9634658..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12292 zcmeHMPfQ&}9G>q1?XK*TftCssnrDfIRB9=uMJl!r3WZv=C{QR=>AtsXS-b4w+vU+n zXkXKtv8mBUO*EQbJk%z7uzx&w(StShCediD7h}BX#iZ4X{$^+CACQyA5S>Y8zM1*` ze)H$sZ{BA1F~-n2Wo>4xiZP~97RXDf_=_a$A}>mbxTly96wiXmjO%Bp^+9HGk+Cc=gQ8=GKmO|I9WZB)9WR`a3rBqTS#rTfPTtyu8|3@sSBS*<%%t4K zw>NijSE-S_yL)%f>Rw}vSL7Xgdf#N|_+GHz&IN>Hyey!7?aBIHU(OcxF-PD9BZfIJ9NI@i;j_pzJQDc1a90#K?9lkqi%$ji zQ#K9m&J9ir1`n7)*7hvN zJ3N$k0w?3z1D-iym!nbF=T?eSSE;h^#u^gLWr`Q|pEc=jMWS7`w_9^>jsi~L zMZAhLcnz=PUA&J=_!ytz3O>h|_zpkfXIz&{OUx_y(fL(N#0|pu9Fl_L?`VlLODK4E zPw$#N%UQwSlu6yLxu+@;^7fsbH?^?f@!u}PNO@9Pk>utj6)F2p9aq<^txc{oQcHe&E9W9_lDCi_*JQIHxk01j!4px_*qGcT#LtVQH4?R@^Ac%oHQK~M;KkC~ zZtM_}=PTxFYt~kmt}_febYc>tA=#~K9RGw)ud+GzL!{B)*&kR51Jzhh%51`Rq|t#c zQf3eO@Fe;%fc+T5A!Lw+O}g~)JaPyzi(`>KPvRw9ivuZ7828!h3s>J=jd+G20%XtfG zZHfWKz~5v5#a;bfoixZ&KjPx9ouYh*vPi&+ xrGNcHfO`L{_kW~3RVW4&1BwB~fMP%~pcqgLCS5T0$TCaBPhptr?ym6mFY;30$x9)%Qou%ZbmHV~4Mr1nsv5nsroPvY}9 z`%`Iby^6|A*!?E6GYRu;*vS9@v!{Lwpbh{A4uKUDr!^wh#aNMww$u=rd`1STH%lj8 z7<((;WcZB?h`rkc7gD@NP~N{+ZxRM+)@;7BO0~AJxn-E9u`?V5ksr_OcpCZXwKI-q zPT-F`H@T5|=4R8>b`!aBY|qrv0S62u~3LBC`^SSs!*m|45q@-&b6PVu~4YOf$8Rh={Gaop)mP&d_I@% zz$}F{69dFRnSrXht&949@qPba4x&3^fEf5!46s_y>Dic)uB|J{iCW8X+~E)+{0fDi lA*jewjJ~22@8ghyb}ke|OJkuBEhzLOAZeh982C{JJ^+0hhsgi{ diff --git a/006simulationBasics/assets/.DS_Store b/006simulationBasics/assets/.DS_Store deleted file mode 100644 index a5027ca0258ec2476ed598fa8d006535dd4582fe..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK%}(1u5S~ra;`B$#r4rm$J*Sn4fl!Hq6@k=ar6A={s@AS6;>wMq*danDVBiJ% zCUESN^m#fnJCR6IZY|JiN80_yGdo^?pS4~u0I1G5S_fzVfP;;&_5{1%80D!gSw$k0 zRCJGQ7$#|mSJ&ZiX|xSk1*`%OO#xcFRrm}UWZ~rI`c2|2cio?=Qms9DyyDdB&a;DF zJc!asCmj!>?0vVNPP%dQB@9L%*w2G}oOOZ`XWj*QA2aOlr)h%zfsF3OQQrU9SSyNG zZ@l%U-e_-4o4ROky6Agb(`nst>Wv@HihYEgKe*VL_+%hcLTZCj{)pHVv@ZupRBw^F;nq>xyk zR)Mc`FYS(qwKkF1hP(YIh%to)S}Tx10LPHR81jFe-~yQis{H2fuani}JiWh1urpf) ztO5^I0s1~@Y=pjGX^=l1*zpknv4&wb^yw@?HCoUYEDd4?O_@?eQ>x^Mp-ef(wT$xx zOM|8y6wi$Jk(rg8P!!LOam~X)`37xo6|f4-D^N9;4cht@RSFy2SPLqS^3zh~kf@XgNSO(i!1@2UV EU!nB#ApigX diff --git a/006simulationBasics/libraries/.DS_Store b/006simulationBasics/libraries/.DS_Store deleted file mode 100644 index 2b852ca3daacc764ab2e4a1f0711709849ec773b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKO-sW-5S^`66RpsTpts;zrS+qw;31R>9)$`XtY|{24aTM8VpRsF!OK5`qu8z$(b{Fd`h1skqrNwkTr!vc!4poriXge4#M^= z{5&^DE%NCWW1uhr0};iuuf144*h9UCmEWj+YF*#zAM&M9GoTrmKL*tPX{^p)>AGUg zfM(za2KfG9K{?tAQ;A~hz#v)xAiqWmfz5jfo?|Jr6{Zs5fiRg0l&MU$7)+*P-coV4 z!c?M6C#ISYroPNnhr-0y@qSB$6SF1iQ8S}baA5GFvngPwgzhZ!8 zYxPS5Z-NTO;8~hL2toxm9*6s!9xfYJPIlFU_}!mHV~51r1nsv5nsroPvY}9 zv%5J2<5k4Y!0b0WKfBovvOkP5?ks~YV+LbP14ZO$)Cjt3Lk*RT$i*04*7H~C+>a8! zW}v_5!f$W0kR`0gELQ#gcYhv*X=YiUywPlJwYN20*LJ6qFbVyB$_;}D z-&@=YJM*$->Uawgx%RRdM1(y~k_han%ASNlHoG$p*X!f+ez#+u4hMP1To2DIu=|5N z*ELNyKD7O#lZ&gdmp{K0uaZCxTnpJ#Si&0^m9;#%i#ST+NAQ<5WiBBxKnxHA#K7h< zpw0wsXLBi_l@kNRzz+=I{$PS4+6oJaV(Wkgug@57A)KQQI<0Si`l_%igduyKg@r^M T1^uENkS+p(5Ne2lUtr)1_!>u# diff --git a/006simulationBasics/libraries/frameworks/io2012/.DS_Store b/006simulationBasics/libraries/frameworks/io2012/.DS_Store deleted file mode 100644 index 397ac06e493b02dc10e993ef22d2c200db101585..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKO-lnY5S_HuZvB8>1ib~%Ra&d91rJM6@F-O9U`2ObwUwnS-K|ARb;W~Me~L$c ziND90WCY#TgO~b229h_)WH!8)CTRdb)O%hDAP)c*7Q)O7R%49fR7NbtJror5jqu9# z0~cG*?$yX>(_s`a3j8(&Xz!-s6ha8y{>T06x5KDdd=;s5W@d zb-eJf(F*#Fws+<_-6Q2kPSgwQPFF?toT!Bnu?hgn=Vx*b30Two84 z&VmPLa1IXiz=vq^97~n8je=ZRFDs5!#c`84K7E&Cf=z;J3NC+Q6_H`BAj_4~m{olI zEdI!7~efp$IiQ zeqXBLAZ(4MHVPO8J}Z#c%{<-zJ72&5KPQ=%QNSqhuM`lO?Z$Q;De>JpLXPfQiRAOK6nfDj~ diff --git a/006simulationBasics/libraries/frameworks/io2012/default/.DS_Store b/006simulationBasics/libraries/frameworks/io2012/default/.DS_Store deleted file mode 100644 index 7f3dbc087e86674c99384c9eb719e9fbc2100016..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK%}T>S5Z-O8Ca92$ptr?ymDbjugNG0*cob6T!HOnEY$PP5N$sITBffx-;?wv% z&g^c*TD|ljT4rGOo1L9Wm@i>>hcU*TVNhqxVvHG}h$Rz-Zv@v-XQZS(6+n*9Nc(=2 z_%M6*`!mtx_=^nSw=1)2ma^0zeg1w?m}a%w8!weBOUo;UX&P(YP8bKt$VrBAke<7} zWaNgyjqeREq@8)$Fm=3vTsiZy9;`^aog@+1T^-#CgRFOHZH>qEgT4K#*l9NMsu&+0 z)~ce}ILdR=Fih*k*x24ZK5cvX!(;KJsN?XLNm zOfyhcQwz`klb`$l=_HyF1H`~WF~BP=x8*=d`fQyk4$oQvdIgGtafQN<6fopb46%3= cZ-Pnzzd!@f)>tS64+vcZBn>nW1Ha0^I}0&>$p8QV diff --git a/006simulationBasics/libraries/frameworks/io2012/default/js/.DS_Store b/006simulationBasics/libraries/frameworks/io2012/default/js/.DS_Store deleted file mode 100644 index 49e525c623f2216d3a576cc359869c7d339b8479..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK%}T>S5T3PFQ&i|h(A(m22ch73mc&zB}d4d>sm9xghI`cKmhmftu@^;4`Bit8JjR;grd_qsvoM^h)7g#P%t zJ&305!0&r*e53TlO(tWt_n z*{oJ%qkfjACCe(6->uz)qw~v-n?Ao}ubM=Gd@I>8IEOb>mg;$I$KfyvAJ8|?o5wRU z1Iz$3zznP&1LiESwpOonu9z8M27X|G_6LcL&^DN9R9gpjbbTg&k&py+dP@*WgSNp; zBYIGTPDRwI!aOmAPDi^makjxsqfQ5*R>pbE%JavIP^+U|s&EjtM(&vbW?+$lf*zLX z{J+4zOztCpF@;CW05kB<7!bu)yX9a}=4@RmkIq_&?G76W#buS5Z-O8CRm{tL2rxaQd(^l!9xfYJPIlFU_}!mO(Z0xN$sITBfgMFpTy^J zW_K%=+JhGnI|H-dWPY;jw_zvC7~}TDZ!uP5j2WPaB@>2k1mmbnQqmqoF5eNckPTVD zGS*niCdXf70Qas6JEr#S>;B!d)SIRwFG@VfdG$t7m}br9J1>Q8Kv=8f| z-8s$cVs_GLf_-$H=cZwpwKrq;pmBE5bMwci;#rZ&;k%Qvqj3%|V60r%gENk!BpyP} zynbFsNDL4I#K1Z*pwB*IdmR=_Ya|AUfgdq|=Ys%6v@{k9<(|#uCEwem4jdCJWFGtP?a+-XNLFanYq59a5+2pg-mDMQb;2)KnyH0 zP*#sM?EmMh@BfQM^h6901OJKvUg(b(|*9y>EP!!B76n>U~AzLxzVk_PQ al>&Z&2B4*}PzW9n`Vo*c&_E3QDgz(d%1n0v diff --git a/006simulationBasics/libraries/highlighters/highlight.js/.DS_Store b/006simulationBasics/libraries/highlighters/highlight.js/.DS_Store deleted file mode 100644 index 132bdd46613f1d35068aab965c19d4e0a9634658..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12292 zcmeHMPfQ&}9G>q1?XK*TftCssnrDfIRB9=uMJl!r3WZv=C{QR=>AtsXS-b4w+vU+n zXkXKtv8mBUO*EQbJk%z7uzx&w(StShCediD7h}BX#iZ4X{$^+CACQyA5S>Y8zM1*` ze)H$sZ{BA1F~-n2Wo>4xiZP~97RXDf_=_a$A}>mbxTly96wiXmjO%Bp^+9HGk+Cc=gQ8=GKmO|I9WZB)9WR`a3rBqTS#rTfPTtyu8|3@sSBS*<%%t4K zw>NijSE-S_yL)%f>Rw}vSL7Xgdf#N|_+GHz&IN>Hyey!7?aBIHU(OcxF-PD9BZfIJ9NI@i;j_pzJQDc1a90#K?9lkqi%$ji zQ#K9m&J9ir1`n7)*7hvN zJ3N$k0w?3z1D-iym!nbF=T?eSSE;h^#u^gLWr`Q|pEc=jMWS7`w_9^>jsi~L zMZAhLcnz=PUA&J=_!ytz3O>h|_zpkfXIz&{OUx_y(fL(N#0|pu9Fl_L?`VlLODK4E zPw$#N%UQwSlu6yLxu+@;^7fsbH?^?f@!u}PNO@9Pk>utj6)F2p9aq<^txc{oQcHe&E9W9_lDCi_*JQIHxk01j!4px_*qGcT#LtVQH4?R@^Ac%oHQK~M;KkC~ zZtM_}=PTxFYt~kmt}_febYc>tA=#~K9RGw)ud+GzL!{B)*&kR51Jzhh%51`Rq|t#c zQf3eO@Fe;%fc+T5A!Lw+O}g~)JaPyzi(`>KPvRw9ivuZ7828!h3s>J=jd+G20%XtfG zZHfWKz~5v5#a;bfoixZ&KjPx9ouYh*vPi&+ xrGNcHfO`L{_kW~3RVW4&1BwB~fMP%~pcqgLCfgc5S?w)VACSyf?94X&Y?;OZHUx^6%~miQX=(05ZH2PELm|CJI%oa4E!J9 z$S>jd@Md?B;(STHM5x+{X5VCH$Ig3}ce6w!y3?>pR3jn>&RBVfVU2N}eZ}@nrV145 z8X2X*EWHWhBv_ek6IKDM!2hNIzq?iPDaB_<<@fhTa1%#q)@b|@d;67x>I27houk23 zG!BzlH<^yZ^lfjH%z9Bc4E)JE6=!}nO}qX?Ro?j72o)9glO#qwFte|sFdMzE9p`zw zRhKUsoq1j6?Xw2r*7BA#D)Ws$F*AB=&$@6EORud1heZGw?ljVm7+sO7iifb4xaaPx`!(A0HZ<2F(*G4Z( z1`Cb4orJnGu4C>j%n3!PyCW~vbP}FMJ6Z*-0%ZmE_17Bj|F1Tm|I1DGn^nLnaIX{) zmCN2`7nIE2x~Q!;8c}5B_F%ufV}od>|s3 zNp^m7v%i_$-{Bz~V?wTdz-dnPe%CML+O%Vx<_z4;2e?lLcZUM@ z)2V;I?am~e=`8dUCey~BDexwB81nMy6J zuBi!D`Rjt!BUS!XLw$hCwM#}uWJ!{hvr@_2Ma!Ez)cpt2qX(Tg2Uq>fn-j^Q>tPJF zC*p<~-$6CpyMXDepY6CIxVIt$cRje$RH~ttq6sV=FS69Wk^KjpNb*KDdOZfi8ftS6 zSPEXw#&CJ;3z|H|ce27!(-`cJTiiREFb$*4wDhEI#=AO`+MZ;#qnmDZc3Wm5xyo+XrznG#wo#)# z^&zc^dZw%fW&Zh#8&<5@usNeln_lcG@sx&#bW4vI z+NNPXK)O^bs>Ne^d`CA8vUpP8u4@T-8dS+0akXE|6#HgAIIG<2$@R|m(i@}qSZ~I7 zyO?rDk~76~=2kpZ?)Bzt(ZgG;N@$eFBq>u|x!~bPs`5Xe!ybSa`slLdp1iNH$xtJjp~Pf*d}w9ks;2y|;UNdAvW`19uYG)7Nq*tNfN$wt``_8L3Q&aw0C0=vjQV_&du*w5@Yc8&eP{saax z6oC)sz#<4hHPpZ|SPAQ(9r|D!sIUtLU@shmr{NiR77oKPI1aDFNjL@Xz-c%G=ix*6 z7%st=@D+RwSKuf36@EuR8Ko3z_%lNp27v>-93ewCVWqe$}_4%c)6xcfVaq&KuUuDV!Te&_i+|~J~ z1EtWO3w$Kmmi6QGHqn;0kHp%sX`B!wTcN(L?w;O-@GILf5$adYd0D3#C*1Na>Dodqm>g`2B&|V}o z*vp@wyZkwtUHDopYPuwrj+=bWM$MN)mAIIC9E zuTSj6{y%g7?fH1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T09)$`XtY|{24aTM8VpRsF!OK5`qu8z$(b{Fd`h1skqrNwkTr!vc!4poriXge4#M^= z{5&^DE%NCWW1uhr0};iuuf144*h9UCmEWj+YF*#zAM&M9GoTrmKL*tPX{^p)>AGUg zfM(za2KfG9K{?tAQ;A~hz#v)xAiqWmfz5jfo?|Jr6{Zs5fiRg0l&MU$7)+*P-coV4 z!c?M6C#ISYroPNnhr-0y@qSB$6SF1iQ8S}baA5GFvngPwgzhZ!8 zYxPS5Z-NTO;8~hL2toxm9*6s!9xfYJPIlFU_}!mHV~51r1nsv5nsroPvY}9 zv%5J2<5k4Y!0b0WKfBovvOkP5?ks~YV+LbP14ZO$)Cjt3Lk*RT$i*04*7H~C+>a8! zW}v_5!f$W0kR`0gELQ#gcYhv*X=YiUywPlJwYN20*LJ6qFbVyB$_;}D z-&@=YJM*$->Uawgx%RRdM1(y~k_han%ASNlHoG$p*X!f+ez#+u4hMP1To2DIu=|5N z*ELNyKD7O#lZ&gdmp{K0uaZCxTnpJ#Si&0^m9;#%i#ST+NAQ<5WiBBxKnxHA#K7h< zpw0wsXLBi_l@kNRzz+=I{$PS4+6oJaV(Wkgug@57A)KQQI<0Si`l_%igduyKg@r^M T1^uENkS+p(5Ne2lUtr)1_!>u# diff --git a/007typesOfQuestions/libraries/frameworks/io2012/.DS_Store b/007typesOfQuestions/libraries/frameworks/io2012/.DS_Store deleted file mode 100644 index 397ac06e493b02dc10e993ef22d2c200db101585..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKO-lnY5S_HuZvB8>1ib~%Ra&d91rJM6@F-O9U`2ObwUwnS-K|ARb;W~Me~L$c ziND90WCY#TgO~b229h_)WH!8)CTRdb)O%hDAP)c*7Q)O7R%49fR7NbtJror5jqu9# z0~cG*?$yX>(_s`a3j8(&Xz!-s6ha8y{>T06x5KDdd=;s5W@d zb-eJf(F*#Fws+<_-6Q2kPSgwQPFF?toT!Bnu?hgn=Vx*b30Two84 z&VmPLa1IXiz=vq^97~n8je=ZRFDs5!#c`84K7E&Cf=z;J3NC+Q6_H`BAj_4~m{olI zEdI!7~efp$IiQ zeqXBLAZ(4MHVPO8J}Z#c%{<-zJ72&5KPQ=%QNSqhuM`lO?Z$Q;De>JpLXPfQiRAOK6nfDj~ diff --git a/007typesOfQuestions/libraries/frameworks/io2012/default/.DS_Store b/007typesOfQuestions/libraries/frameworks/io2012/default/.DS_Store deleted file mode 100644 index 7f3dbc087e86674c99384c9eb719e9fbc2100016..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK%}T>S5Z-O8Ca92$ptr?ymDbjugNG0*cob6T!HOnEY$PP5N$sITBffx-;?wv% z&g^c*TD|ljT4rGOo1L9Wm@i>>hcU*TVNhqxVvHG}h$Rz-Zv@v-XQZS(6+n*9Nc(=2 z_%M6*`!mtx_=^nSw=1)2ma^0zeg1w?m}a%w8!weBOUo;UX&P(YP8bKt$VrBAke<7} zWaNgyjqeREq@8)$Fm=3vTsiZy9;`^aog@+1T^-#CgRFOHZH>qEgT4K#*l9NMsu&+0 z)~ce}ILdR=Fih*k*x24ZK5cvX!(;KJsN?XLNm zOfyhcQwz`klb`$l=_HyF1H`~WF~BP=x8*=d`fQyk4$oQvdIgGtafQN<6fopb46%3= cZ-Pnzzd!@f)>tS64+vcZBn>nW1Ha0^I}0&>$p8QV diff --git a/007typesOfQuestions/libraries/frameworks/io2012/default/js/.DS_Store b/007typesOfQuestions/libraries/frameworks/io2012/default/js/.DS_Store deleted file mode 100644 index 49e525c623f2216d3a576cc359869c7d339b8479..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK%}T>S5T3PFQ&i|h(A(m22ch73mc&zB}d4d>sm9xghI`cKmhmftu@^;4`Bit8JjR;grd_qsvoM^h)7g#P%t zJ&305!0&r*e53TlO(tWt_n z*{oJ%qkfjACCe(6->uz)qw~v-n?Ao}ubM=Gd@I>8IEOb>mg;$I$KfyvAJ8|?o5wRU z1Iz$3zznP&1LiESwpOonu9z8M27X|G_6LcL&^DN9R9gpjbbTg&k&py+dP@*WgSNp; zBYIGTPDRwI!aOmAPDi^makjxsqfQ5*R>pbE%JavIP^+U|s&EjtM(&vbW?+$lf*zLX z{J+4zOztCpF@;CW05kB<7!bu)yX9a}=4@RmkIq_&?G76W#buS5Z-O8CRm{tL2rxaQd(^l!9xfYJPIlFU_}!mO(Z0xN$sITBfgMFpTy^J zW_K%=+JhGnI|H-dWPY;jw_zvC7~}TDZ!uP5j2WPaB@>2k1mmbnQqmqoF5eNckPTVD zGS*niCdXf70Qas6JEr#S>;B!d)SIRwFG@VfdG$t7m}br9J1>Q8Kv=8f| z-8s$cVs_GLf_-$H=cZwpwKrq;pmBE5bMwci;#rZ&;k%Qvqj3%|V60r%gENk!BpyP} zynbFsNDL4I#K1Z*pwB*IdmR=_Ya|AUfgdq|=Ys%6v@{k9<(|#uCEwem4jdCJWFGtP?a+-XNLFanYq59a5+2pg-mDMQb;2)KnyH0 zP*#sM?EmMh@BfQM^h6901OJKvUg(b(|*9y>EP!!B76n>U~AzLxzVk_PQ al>&Z&2B4*}PzW9n`Vo*c&_E3QDgz(d%1n0v diff --git a/007typesOfQuestions/libraries/highlighters/highlight.js/.DS_Store b/007typesOfQuestions/libraries/highlighters/highlight.js/.DS_Store deleted file mode 100644 index 132bdd46613f1d35068aab965c19d4e0a9634658..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12292 zcmeHMPfQ&}9G>q1?XK*TftCssnrDfIRB9=uMJl!r3WZv=C{QR=>AtsXS-b4w+vU+n zXkXKtv8mBUO*EQbJk%z7uzx&w(StShCediD7h}BX#iZ4X{$^+CACQyA5S>Y8zM1*` ze)H$sZ{BA1F~-n2Wo>4xiZP~97RXDf_=_a$A}>mbxTly96wiXmjO%Bp^+9HGk+Cc=gQ8=GKmO|I9WZB)9WR`a3rBqTS#rTfPTtyu8|3@sSBS*<%%t4K zw>NijSE-S_yL)%f>Rw}vSL7Xgdf#N|_+GHz&IN>Hyey!7?aBIHU(OcxF-PD9BZfIJ9NI@i;j_pzJQDc1a90#K?9lkqi%$ji zQ#K9m&J9ir1`n7)*7hvN zJ3N$k0w?3z1D-iym!nbF=T?eSSE;h^#u^gLWr`Q|pEc=jMWS7`w_9^>jsi~L zMZAhLcnz=PUA&J=_!ytz3O>h|_zpkfXIz&{OUx_y(fL(N#0|pu9Fl_L?`VlLODK4E zPw$#N%UQwSlu6yLxu+@;^7fsbH?^?f@!u}PNO@9Pk>utj6)F2p9aq<^txc{oQcHe&E9W9_lDCi_*JQIHxk01j!4px_*qGcT#LtVQH4?R@^Ac%oHQK~M;KkC~ zZtM_}=PTxFYt~kmt}_febYc>tA=#~K9RGw)ud+GzL!{B)*&kR51Jzhh%51`Rq|t#c zQf3eO@Fe;%fc+T5A!Lw+O}g~)JaPyzi(`>KPvRw9ivuZ7828!h3s>J=jd+G20%XtfG zZHfWKz~5v5#a;bfoixZ&KjPx9ouYh*vPi&+ xrGNcHfO`L{_kW~3RVW4&1BwB~fMP%~pcqgLC_M78 z(OIE#ho(yjXoesez++77?L~P(le*q*w=j{Nt;g8@>7?Gn=niL5%r;L`z`RG!%cqsu z(N+Pgz<;0suMZxa(KlFXl%)fW907neq{R^PS%PakgTBF1BYI#;mjZREGDi%h%aQlY zINxBYQJ0gFC*wZm$;zBilsp}IPll87HQLrHU=^q;u&gf|y#Mb$eEzQ%*(X_98nYcsz+3SuTnv342SDFosSz2N{SXitY-1Hz Gr~=p18^Xx| diff --git a/008sourcesOfDataSets/assets/.DS_Store b/008sourcesOfDataSets/assets/.DS_Store deleted file mode 100644 index ab559ccf92cbe3108ca3af89160dc0a45c9d0342..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15364 zcmeHMZEO@p7@qfSfjzjh%cni0R*?Hz><``qpIFzVjEWj9(=;BuPQuZH-Kj+si37wjWWP#$DIT+K87~LI@ z4c_7{Dg*<90l|P^KrkQ}xEmOt-)x?wNwyWaU_dY+7`Vm&pC1BraT|7Q&bHRnL7BA$ zAX`k;R-&@Z3uFV14LdexTY5qX>`=0HC^%aTu*0c7;P{0do3pJQ&cNAxfb(W>b|_%I zo!Spr?hL}V6}ezQFmNjaeD7Yw;>=`bZ1~3gyRMn(VDLO(QSrF(6C{sE^7cfvWWpG3 zG=`E1vpcfQ7>;NOHKwF`t#VpP51EZh%6ihKq_@!%tK4oFI+c4I@2HkYZ|jq1X0r>c zs;fhlftpa&NM#^fR~w}AlBFXf9!c`Zr=;m~7cFmYSN1%c+q=*1IXLQPz5*osufxbh zQc2xN_EQb_E@B!RVEs3Mdp|aK$HDot*{b^bdXA^Y!d7Qt3pv;h<*|)$a5ffKY|mXs zp_`dD`-r9J^*o9T*FMq2NnYOry_@@{d6f<=ZX_exF11fCG3i6Cq1(2Un$gtZK6!Fn z(c?q9l2#jZojaM)xS) zsculIO)aA~QOnfS6#ll>LEenHNllq#%fmq%tVepcq%`oz;<^>9*KZn?Cr_C=ZMxUn zMZ+nX*0ySDYU3~;C7p^HSCa`X*&oelrWVuH_M|ePPKHX4XH@pjd}vmg&+F#elc0XA zGZMVLgnUw>h&gl1A1?Fx+#!;ondF$IrbI1$S$*A+3)O6_BZ(a1zeI zr|>zPhi~B`d`;Q^lTc$q!x8&;SkFYJ$VAxzclJ6 zG0&UrE;^Z!-uzs`3*E=Mj5IS)TU@`j?oyYFES>wgc%N`rnLN%?uAd8c)fhc1w&nsq zNw#I(7_E)Br0plMwr?B*f@CSw-`UmOvv3RuAbG}8=52KOCHsb5V!yB}>?->UieV}Q zU;!+KT37+AVGXpvI#>@;=!JeT;Au#K3A;&^2T6~wz^m{Ysq!eiLz?^uPQzLF7(Rh> z@C96e@8L5106)S{a0RY9y7b`#Sc0WE8!Iq~)mVeIxD;35Ds06lc49a7U@vYZg>rr7 za4+t|19%wUC{Sj+K$&k|S7yOF0onGOmO$_2)p`e)K&9Dib?p*bBm_faEfRL~Re}w~ zb&uLCRqQvlUwNaTV6!GK^uFmPK2ifoSnKmT9l{{R1N z+Yt_e0l~n%%K#KNMVcC^|M~rFArz#F09{+?;)(m^Y-@#3#$9;5bsSGO{5am){8OEC z=3_k%JAOIaTHzFDg_E^U^Y8ed0b>9EKThn#{(tm7+W&L?i6j^h3<*r1MjL>(e>pb}dfFgJ*tm%1b?CbAA> zYK=IYR7IHP;Zm**SOzQu{~rVL-Cd&zjVY#*=HK66VUZ@4@Vwt_Wwo`oe$Q#Qod;*9 zNfzakL0)H3^*R{mlOT!Wke6?iFSw|y0Wa0eOD@KkQT|Dur|{2A_GuD{@w?8W>9p7H z_qW}>-M!hiJKf*+q<=7*wH>G3`RQyv-g$a-!e`$uo9~)DhA)khhX$|U2b{T13K1UH zl_(K?ORuO>{Z-VZk0dC?D5g&s4bgQ@1%mjZPuGgl0z%Mo`?o^PYIm&fs&rz$Mr$ntmVreER`swW&;P^Q@BfQMc4Qf_4BROOSZf#z z2WZKhtxL_xv(|;ahf0xojYd@hV~%6x$fI}*sswYcbb!9WMk68+`$s_0V2x$qpEB?V DP6V!} diff --git a/008sourcesOfDataSets/libraries/.DS_Store b/008sourcesOfDataSets/libraries/.DS_Store deleted file mode 100644 index 2b852ca3daacc764ab2e4a1f0711709849ec773b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKO-sW-5S^`66RpsTpts;zrS+qw;31R>9)$`XtY|{24aTM8VpRsF!OK5`qu8z$(b{Fd`h1skqrNwkTr!vc!4poriXge4#M^= z{5&^DE%NCWW1uhr0};iuuf144*h9UCmEWj+YF*#zAM&M9GoTrmKL*tPX{^p)>AGUg zfM(za2KfG9K{?tAQ;A~hz#v)xAiqWmfz5jfo?|Jr6{Zs5fiRg0l&MU$7)+*P-coV4 z!c?M6C#ISYroPNnhr-0y@qSB$6SF1iQ8S}baA5GFvngPwgzhZ!8 zYxPS5Z-NTO;8~hL2toxm9*6s!9xfYJPIlFU_}!mHV~51r1nsv5nsroPvY}9 zv%5J2<5k4Y!0b0WKfBovvOkP5?ks~YV+LbP14ZO$)Cjt3Lk*RT$i*04*7H~C+>a8! zW}v_5!f$W0kR`0gELQ#gcYhv*X=YiUywPlJwYN20*LJ6qFbVyB$_;}D z-&@=YJM*$->Uawgx%RRdM1(y~k_han%ASNlHoG$p*X!f+ez#+u4hMP1To2DIu=|5N z*ELNyKD7O#lZ&gdmp{K0uaZCxTnpJ#Si&0^m9;#%i#ST+NAQ<5WiBBxKnxHA#K7h< zpw0wsXLBi_l@kNRzz+=I{$PS4+6oJaV(Wkgug@57A)KQQI<0Si`l_%igduyKg@r^M T1^uENkS+p(5Ne2lUtr)1_!>u# diff --git a/008sourcesOfDataSets/libraries/frameworks/io2012/.DS_Store b/008sourcesOfDataSets/libraries/frameworks/io2012/.DS_Store deleted file mode 100644 index 397ac06e493b02dc10e993ef22d2c200db101585..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKO-lnY5S_HuZvB8>1ib~%Ra&d91rJM6@F-O9U`2ObwUwnS-K|ARb;W~Me~L$c ziND90WCY#TgO~b229h_)WH!8)CTRdb)O%hDAP)c*7Q)O7R%49fR7NbtJror5jqu9# z0~cG*?$yX>(_s`a3j8(&Xz!-s6ha8y{>T06x5KDdd=;s5W@d zb-eJf(F*#Fws+<_-6Q2kPSgwQPFF?toT!Bnu?hgn=Vx*b30Two84 z&VmPLa1IXiz=vq^97~n8je=ZRFDs5!#c`84K7E&Cf=z;J3NC+Q6_H`BAj_4~m{olI zEdI!7~efp$IiQ zeqXBLAZ(4MHVPO8J}Z#c%{<-zJ72&5KPQ=%QNSqhuM`lO?Z$Q;De>JpLXPfQiRAOK6nfDj~ diff --git a/008sourcesOfDataSets/libraries/frameworks/io2012/default/.DS_Store b/008sourcesOfDataSets/libraries/frameworks/io2012/default/.DS_Store deleted file mode 100644 index 7f3dbc087e86674c99384c9eb719e9fbc2100016..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK%}T>S5Z-O8Ca92$ptr?ymDbjugNG0*cob6T!HOnEY$PP5N$sITBffx-;?wv% z&g^c*TD|ljT4rGOo1L9Wm@i>>hcU*TVNhqxVvHG}h$Rz-Zv@v-XQZS(6+n*9Nc(=2 z_%M6*`!mtx_=^nSw=1)2ma^0zeg1w?m}a%w8!weBOUo;UX&P(YP8bKt$VrBAke<7} zWaNgyjqeREq@8)$Fm=3vTsiZy9;`^aog@+1T^-#CgRFOHZH>qEgT4K#*l9NMsu&+0 z)~ce}ILdR=Fih*k*x24ZK5cvX!(;KJsN?XLNm zOfyhcQwz`klb`$l=_HyF1H`~WF~BP=x8*=d`fQyk4$oQvdIgGtafQN<6fopb46%3= cZ-Pnzzd!@f)>tS64+vcZBn>nW1Ha0^I}0&>$p8QV diff --git a/008sourcesOfDataSets/libraries/frameworks/io2012/default/js/.DS_Store b/008sourcesOfDataSets/libraries/frameworks/io2012/default/js/.DS_Store deleted file mode 100644 index 49e525c623f2216d3a576cc359869c7d339b8479..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK%}T>S5T3PFQ&i|h(A(m22ch73mc&zB}d4d>sm9xghI`cKmhmftu@^;4`Bit8JjR;grd_qsvoM^h)7g#P%t zJ&305!0&r*e53TlO(tWt_n z*{oJ%qkfjACCe(6->uz)qw~v-n?Ao}ubM=Gd@I>8IEOb>mg;$I$KfyvAJ8|?o5wRU z1Iz$3zznP&1LiESwpOonu9z8M27X|G_6LcL&^DN9R9gpjbbTg&k&py+dP@*WgSNp; zBYIGTPDRwI!aOmAPDi^makjxsqfQ5*R>pbE%JavIP^+U|s&EjtM(&vbW?+$lf*zLX z{J+4zOztCpF@;CW05kB<7!bu)yX9a}=4@RmkIq_&?G76W#buS5Z-O8CRm{tL2rxaQd(^l!9xfYJPIlFU_}!mO(Z0xN$sITBfgMFpTy^J zW_K%=+JhGnI|H-dWPY;jw_zvC7~}TDZ!uP5j2WPaB@>2k1mmbnQqmqoF5eNckPTVD zGS*niCdXf70Qas6JEr#S>;B!d)SIRwFG@VfdG$t7m}br9J1>Q8Kv=8f| z-8s$cVs_GLf_-$H=cZwpwKrq;pmBE5bMwci;#rZ&;k%Qvqj3%|V60r%gENk!BpyP} zynbFsNDL4I#K1Z*pwB*IdmR=_Ya|AUfgdq|=Ys%6v@{k9<(|#uCEwem4jdCJWFGtP?a+-XNLFanYq59a5+2pg-mDMQb;2)KnyH0 zP*#sM?EmMh@BfQM^h6901OJKvUg(b(|*9y>EP!!B76n>U~AzLxzVk_PQ al>&Z&2B4*}PzW9n`Vo*c&_E3QDgz(d%1n0v diff --git a/008sourcesOfDataSets/libraries/highlighters/highlight.js/.DS_Store b/008sourcesOfDataSets/libraries/highlighters/highlight.js/.DS_Store deleted file mode 100644 index 132bdd46613f1d35068aab965c19d4e0a9634658..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12292 zcmeHMPfQ&}9G>q1?XK*TftCssnrDfIRB9=uMJl!r3WZv=C{QR=>AtsXS-b4w+vU+n zXkXKtv8mBUO*EQbJk%z7uzx&w(StShCediD7h}BX#iZ4X{$^+CACQyA5S>Y8zM1*` ze)H$sZ{BA1F~-n2Wo>4xiZP~97RXDf_=_a$A}>mbxTly96wiXmjO%Bp^+9HGk+Cc=gQ8=GKmO|I9WZB)9WR`a3rBqTS#rTfPTtyu8|3@sSBS*<%%t4K zw>NijSE-S_yL)%f>Rw}vSL7Xgdf#N|_+GHz&IN>Hyey!7?aBIHU(OcxF-PD9BZfIJ9NI@i;j_pzJQDc1a90#K?9lkqi%$ji zQ#K9m&J9ir1`n7)*7hvN zJ3N$k0w?3z1D-iym!nbF=T?eSSE;h^#u^gLWr`Q|pEc=jMWS7`w_9^>jsi~L zMZAhLcnz=PUA&J=_!ytz3O>h|_zpkfXIz&{OUx_y(fL(N#0|pu9Fl_L?`VlLODK4E zPw$#N%UQwSlu6yLxu+@;^7fsbH?^?f@!u}PNO@9Pk>utj6)F2p9aq<^txc{oQcHe&E9W9_lDCi_*JQIHxk01j!4px_*qGcT#LtVQH4?R@^Ac%oHQK~M;KkC~ zZtM_}=PTxFYt~kmt}_febYc>tA=#~K9RGw)ud+GzL!{B)*&kR51Jzhh%51`Rq|t#c zQf3eO@Fe;%fc+T5A!Lw+O}g~)JaPyzi(`>KPvRw9ivuZ7828!h3s>J=jd+G20%XtfG zZHfWKz~5v5#a;bfoixZ&KjPx9ouYh*vPi&+ xrGNcHfO`L{_kW~3RVW4&1BwB~fMP%~pcqgLC