diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5b6a065 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.Rproj.user +.Rhistory +.RData +.Ruserdata diff --git a/Class 4 - Swirl.Rproj b/Class 4 - Swirl.Rproj new file mode 100644 index 0000000..8e3c2eb --- /dev/null +++ b/Class 4 - Swirl.Rproj @@ -0,0 +1,13 @@ +Version: 1.0 + +RestoreWorkspace: Default +SaveWorkspace: Default +AlwaysSaveHistory: Default + +EnableCodeIndexing: Yes +UseSpacesForTab: Yes +NumSpacesForTab: 2 +Encoding: UTF-8 + +RnwWeave: Sweave +LaTeX: pdfLaTeX diff --git a/lesson1.csv b/lesson1.csv new file mode 100644 index 0000000..d1cc249 --- /dev/null +++ b/lesson1.csv @@ -0,0 +1,244 @@ +"time","answer","id" +"1474339786951","install.packages(swirl)","YOUR NAME" +"1474339846561","library(swirl)","YOUR NAME" +"1474339855445","swirl()","YOUR NAME" +"1474340041340","5+7","YOUR NAME" +"1474340068619","x<-5+7","YOUR NAME" +"1474340072778","x","YOUR NAME" +"1474340081183","y<-x-3","YOUR NAME" +"1474340083745","y","YOUR NAME" +"1474340104522","z<-c(1.1,9,3.14)","YOUR NAME" +"1474340172310","c()","YOUR NAME" +"1474340187055","?c","YOUR NAME" +"1474340198317","z","YOUR NAME" +"1474340227055","c(z,555,z)","YOUR NAME" +"1474340245124","z*2+100","YOUR NAME" +"1474340271283","my_sqrt<-sqrt(z-1)","YOUR NAME" +"1474340296331","my_sqrt","YOUR NAME" +"1474340328436","my_div<-z/my_sqrt","YOUR NAME" +"1474340354820","my_div","YOUR NAME" +"1474340377028","c(1,2,3,4)+c(0,10)","YOUR NAME" +"1474340399178","c(1,2,3,4)+c(0,10,100)","YOUR NAME" +"1474340428713","z*2+1000","YOUR NAME" +"1474340456153","my_div","YOUR NAME" +"1474340520647","getwd()","YOUR NAME" +"1474340546801","ls()","YOUR NAME" +"1474340554301","x<-9","YOUR NAME" +"1474340561207","ls()","YOUR NAME" +"1474340570124","dir()","YOUR NAME" +"1474340581933","?list.files","YOUR NAME" +"1474340593092","args()","YOUR NAME" +"1474340617773","args(list.files())","YOUR NAME" +"1474340633836","args(list.files)","YOUR NAME" +"1474340655586","old.dir<-dir()","YOUR NAME" +"1474340667307","old.dir<-getwd()","YOUR NAME" +"1474340689460","testdir<-dir.create()","YOUR NAME" +"1474340717901","info()","YOUR NAME" +"1474340733712","skip()","YOUR NAME" +"1474340770803","setwd(testdir)","YOUR NAME" +"1474340787455","file.create(mytest.R)","YOUR NAME" +"1474340824338","list.files","YOUR NAME" +"1474340840617","list.files()","YOUR NAME" +"1474340877339","file.exists(mytest.R)","YOUR NAME" +"1474340891163","file.info(mytest.R)","YOUR NAME" +"1474340911653","?file.rename","YOUR NAME" +"1474340948341","file.rename(mytest.R,mytest2.R)","YOUR NAME" +"1474340986247","file.copy(mytest2.R,mytest3.R)","YOUR NAME" +"1474341006714","?file.path","YOUR NAME" +"1474341033832","file.path(mytest3.R)","YOUR NAME" +"1474341048810","file.path(folder1)","YOUR NAME" +"1474341074058","file.path(folder1,folder2)","YOUR NAME" +"1474341084370","?dir.create","YOUR NAME" +"1474341143501","dir.create(testdir2,file.path(testdir3))","YOUR NAME" +"1474341175654","dir.create(file.path(testdir2, testdir3), recursive = TRUE)","YOUR NAME" +"1474341216336","setwd(old.dir)","YOUR NAME" +"1474341226194","setwd()","YOUR NAME" +"1474341255326","setwd(old.dir)","YOUR NAME" +"1474341316587","delete.response(test.dir)","YOUR NAME" +"1474341324055","delete.response(testdir)","YOUR NAME" +"1474341345366","?","YOUR NAME" +"1474341352438","delete.response()","YOUR NAME" +"1474341384309","par(testdir)","YOUR NAME" +"1474341455839",".unlink(testdir)","YOUR NAME" +"1474341490464","unlink(testdir)","YOUR NAME" +"1474341537596","unlink(mytest.R)","YOUR NAME" +"1474341559814","unlink(testdir2)","YOUR NAME" +"1474341580527","unlink(testdir3)","YOUR NAME" +"1474341583408","next","YOUR NAME" +"1474341602661","skip()","YOUR NAME" +"1474341663117","1","YOUR NAME" +"20","","YOUR NAME" +"1474341670154","pi","YOUR NAME" +"10","","YOUR NAME" +"1474341675332","15","YOUR NAME" +"1","","YOUR NAME" +"1474341687486","?","YOUR NAME" +"1474341697920","?:","YOUR NAME" +"1474341713959","seq(1,20)","YOUR NAME" +"1474341810555","seq(0, 10, by=0.5)","YOUR NAME" +"1474341822709","seq(5, 10, length=30)","YOUR NAME" +"1474341830859","my_seq <- seq(5, 10, length=30).","YOUR NAME" +"1474341835201","my_seq <- seq(5, 10, length=30)","YOUR NAME" +"1474341845015","length(my_seq)","YOUR NAME" +"1474341862624","length(my_seq)","YOUR NAME" +"1474341875527","length(my_seq)","YOUR NAME" +"1474341890147","1","YOUR NAME" +"length(my_seq)","","YOUR NAME" +"1474341900805","seq(along.with = my_seq)","YOUR NAME" +"1474341911370","seq_along(my_seq)","YOUR NAME" +"1474341926699","rep(0,","YOUR NAME" +"1474341926710","| times = 40)","YOUR NAME" +"1474341937468","rep(0, times = 40)","YOUR NAME" +"1474341948336","rep(c(0, 1, 2), times = 10)","YOUR NAME" +"1474341963044","rep(c(0, 1, 2), each = 10)","YOUR NAME" +"1474342078547","history_database","YOUR NAME" +"1474342087561","?history_database","YOUR NAME" +"1474342100867","H <-read.table(~/.rstudio-desktop/history_database, sep=:, fill=T, stringsAsFactors=F)","YOUR NAME" +"1474342100879","names(H) <- c(time, answer)","YOUR NAME" +"1474342100889","H$id <- YOUR NAME","YOUR NAME" +"1474342100902","write.csv(H, file = lesson1.csv, row.names = FALSE)","YOUR NAME" +"1474342149064","H <-read.table(~/.rstudio-desktop/Columbia U/Class 4-Swirl, sep=:, fill=T, stringsAsFactors=F)","YOUR NAME" +"1474342149078","names(H) <- c(time, answer)","YOUR NAME" +"1474342149090","H$id <- YOUR NAME","YOUR NAME" +"1474342149102","write.csv(H, file = lesson1.csv, row.names = FALSE)","YOUR NAME" +"1474342177265","old.dir","YOUR NAME" +"1474342294617","H <-read.table(~/.rstudio-desktop/Columbia U, sep=:, fill=T, stringsAsFactors=F)","YOUR NAME" +"1474342294630","names(H) <- c(time, answer)","YOUR NAME" +"1474342294641","H$id <- YOUR NAME","YOUR NAME" +"1474342294653","write.csv(H, file = lesson1.csv, row.names = FALSE)","YOUR NAME" +"1474342634375","2","YOUR NAME" +"1474342636662","1","YOUR NAME" +"1474342644859","swirl()","YOUR NAME" +"1474557517281","library(swirl)","YOUR NAME" +"1474557540215","swirl()","YOUR NAME" +"1474557563082","swirl()","YOUR NAME" +"1474557579263","5+7","YOUR NAME" +"1474557602644","x<-5+7","YOUR NAME" +"1474557607174","x","YOUR NAME" +"1474557613992","y<-x-3","YOUR NAME" +"1474557616608","y","YOUR NAME" +"1474557631303","z<-c(1.1, 9, 3.14)","YOUR NAME" +"1474557637362","?c","YOUR NAME" +"1474557642969","z","YOUR NAME" +"1474557657276","c(z,555,z)","YOUR NAME" +"1474557702770","z*2+!00","YOUR NAME" +"1474557710200","z*2+100","YOUR NAME" +"1474557745209","my_sqrt<-sqrt(z-1)","YOUR NAME" +"1474557758769","my_sqrt","YOUR NAME" +"1474557782493","my_div<-z/my_sqrt","YOUR NAME" +"1474557844797","my_div","YOUR NAME" +"1474557874273","c(1,2,3,4)+c(0,10)","YOUR NAME" +"1474557896320","c(1,2,3,4)+c(0,10,100)","YOUR NAME" +"1474557937273","z*2+1000","YOUR NAME" +"1474557957243","my_div","YOUR NAME" +"1474558036249","my_vector<-1","YOUR NAME" +"20","","YOUR NAME" +"1474558041828","my_vector","YOUR NAME" +"1474558052740","dim(my_vector)","YOUR NAME" +"1474558065652","length(my_vector)","YOUR NAME" +"1474558076765","dim(my_vector) <- c(4, 5)","YOUR NAME" +"1474558089076","dim(my_vector)","YOUR NAME" +"1474558104247","attributes(my_vector)","YOUR NAME" +"1474558123896","my_vector","YOUR NAME" +"1474558137024","class(my_vector)","YOUR NAME" +"1474558159298","my_matrix<-my_vector","YOUR NAME" +"1474558169205","?matrix","YOUR NAME" +"1474558206873","skip","YOUR NAME" +"1474558250240","matrix(1","YOUR NAME" +"20,4,5)","","YOUR NAME" +"1474558279836","my_matrix2<-my_matrix(1","YOUR NAME" +"20,4,5)","","YOUR NAME" +"1474558307584","my_matrix","YOUR NAME" +"1474558322338","matrix(my_matrix,4,5)","YOUR NAME" +"1474558327275","skip","YOUR NAME" +"1474558332337","skip()","YOUR NAME" +"1474558377662","identical(mymatrix2,matrix(1","YOUR NAME" +"20, nrow=4, ncol=5))","","YOUR NAME" +"1474558385238","skip()","YOUR NAME" +"1474558455989","patients<-(Bill,Gina,Kelly,Sean)","YOUR NAME" +"1474558515950","skip()","YOUR NAME" +"1474558542988","cbind(patients,my_matrix)","YOUR NAME" +"1474558560856","my_data <- data.frame(patients, my_matrix)","YOUR NAME" +"1474558566493","my_data","YOUR NAME" +"1474558584712","class(my_data)","YOUR NAME" +"1474558665652","cnames<-c(patient,age,weight,bp,rating,test)","YOUR NAME" +"1474558678247","?colnames","YOUR NAME" +"1474558725976","colnames(data.frame)<-cnames","YOUR NAME" +"1474558730378","skip()","YOUR NAME" +"1474558741899","my_data","YOUR NAME" +"1474558771516","ls(plants)","YOUR NAME" +"1474558779932","ls()","YOUR NAME" +"1474558797023","class(plants)","YOUR NAME" +"1474558809308","dim(plants)","YOUR NAME" +"1474558826837","nrow(plants)","YOUR NAME" +"1474558835177","ncol(plants)","YOUR NAME" +"1474558843740","object.size(plants)","YOUR NAME" +"1474558852429","names(plants)","YOUR NAME" +"1474558872356","head(plants)","YOUR NAME" +"1474558890840","head(plants,10)","YOUR NAME" +"1474558899896","tail(plants,15)","YOUR NAME" +"1474558913849","summary(plants)","YOUR NAME" +"1474558942134","table(plants$Active_Growth_Period)","YOUR NAME" +"1474558957161","str()","YOUR NAME" +"1474558961660","strplants","YOUR NAME" +"1474558965097","str(plants)","YOUR NAME" +"1474558996993","getwd()","YOUR NAME" +"1474559000484","ls()","YOUR NAME" +"1474559009153","x<-9","YOUR NAME" +"1474559014674","ls()","YOUR NAME" +"1474559021125","list.files()","YOUR NAME" +"1474559030364","?list.files","YOUR NAME" +"1474559041114","args()","YOUR NAME" +"1474559047397","args(list.files)","YOUR NAME" +"1474559081773","old.dir<-wd()","YOUR NAME" +"1474559089144","skip()","YOUR NAME" +"1474559128555","?dir.create","YOUR NAME" +"1474559153576","skip()","YOUR NAME" +"1474559169263","setwd(testdir)","YOUR NAME" +"1474559181175","setwd(testdir)","YOUR NAME" +"1474559199929","file.create(mytest.R)","YOUR NAME" +"1474559206898","str()","YOUR NAME" +"1474559259637","list.files(wd)","YOUR NAME" +"1474559268607","list.files(testdir)","YOUR NAME" +"1474559283586","list.files(wd())","YOUR NAME" +"1474559290711","skip()","YOUR NAME" +"1474559312453","file.exists(mytest.R)","YOUR NAME" +"1474559323707","file.info(mytest.R)","YOUR NAME" +"1474560339957","mytest2.R","YOUR NAME" +"1474560343397","mytest2.Rskip()","YOUR NAME" +"1474560346644","skip()","YOUR NAME" +"1474560450598","mytest3.R<-file.copy(mytest2.R)","YOUR NAME" +"1474560521116","mytest3.R<-file.copy(mytest2.R)","YOUR NAME" +"1474560525188","skip()","YOUR NAME" +"1474560541651","file.path(mytest3.R)","YOUR NAME" +"1474560549627","skip()","YOUR NAME" +"1474560561478","?dir.create","YOUR NAME" +"1474560581314","?dir.create()","YOUR NAME" +"1474560650468","skip()","YOUR NAME" +"1474560673589","setwd()","YOUR NAME" +"1474560735054","skip()","YOUR NAME" +"1474560747918","delete(testdir)","YOUR NAME" +"1474560789723","par(testdir)","YOUR NAME" +"1474560793289","skip()","YOUR NAME" +"1474560841833","TRUE==TRUE","YOUR NAME" +"1474560861227","(FALSE == TRUE) == FALSE","YOUR NAME" +"1474560868419","6==7","YOUR NAME" +"1474560879402","6<7","YOUR NAME" +"1474560895227","10<=10","YOUR NAME" +"1474561417938","H <-read.table(C:\Users\smpep_000\AppData\Local\RStudio-Desktop\history_database, sep=:, fill=T, stringsAsFactors=F)","YOUR NAME" +"1474561417966","names(H) <- c(time, answer)","YOUR NAME" +"1474561417982","H$id <- YOUR NAME","YOUR NAME" +"1474561418000","write.csv(H, file = lesson1.csv, row.names = FALSE)","YOUR NAME" +"1474561554810","H <-read.table(C:\Users\smpep_000\AppData\Local\RStudio-Desktop/history_database, sep=:, fill=T, stringsAsFactors=F)","YOUR NAME" +"1474561554824","names(H) <- c(time, answer)","YOUR NAME" +"1474561554839","H$id <- YOUR NAME","YOUR NAME" +"1474561554866","write.csv(H, file = lesson1.csv, row.names = FALSE)","YOUR NAME" +"1474561674719","H <-read.table(C:\Users\smpep_000\AppData\Local\RStudio-Desktop\history_database, sep=:, fill=T, stringsAsFactors=F)","YOUR NAME" +"1474561674734","names(H) <- c(time, answer)","YOUR NAME" +"1474561674748","H$id <- YOUR NAME","YOUR NAME" +"1474561674764","write.csv(H, file = lesson1.csv, row.names = FALSE)","YOUR NAME" +"1474561880316","H <-read.table(C:\\Users\\smpep_000\\AppData\\Local\\RStudio-Desktop\\history_database, sep=:, fill=T, stringsAsFactors=F)","YOUR NAME" +"1474561880437","names(H) <- c(time, answer)","YOUR NAME" +"1474561880533","H$id <- YOUR NAME","YOUR NAME" +"1474561880621","write.csv(H, file = lesson1.csv, row.names = FALSE)","YOUR NAME" +"1474561944226","H <-read.table(C:\\Users\\smpep_000\\AppData\\Local\\RStudio-Desktop\\history_database, sep=:, fill=T, stringsAsFactors=F)","YOUR NAME"