another.word another.word x=12 y=2 sin(x)*cos(y) q() getwd() x=c(1,5,9) x x/19 sin(x) y=sin(x) y ?c ?getwd help(c) help(c) words=c('red',"pink",'A long paragraph') words x="aslga " getwd( " ") mixture=c("word",3) mixture mixture=c("word","3") mixture mixture/2 y="3" y y/2 longvector=1:10000 longvector=1:100 longvector longvector=1:10000 mean(longvector) median(longvector) sd(longvector) var(longvector) longvector=1:1000000 sd(longvector) ?q ?sd sd() x=1:10 y=log(x) x y logtable=data.frame(x,y) logtable letters() Letters() letters x=1:26 y=log(x) mixtable=data.frame(x,y,letters) mixtable mixtable=data.frame(x,y,letters) str(mixtable) x=1:3 y=x*2 z=c('a','b','a long word') mixtable=data.frame(x,y,z) mixtable str(mixtable) str(z) x=c(1,2,'aa') x mixtable=data.frame(x,y,z) str(mixtable) mixtable=data.frame(x,y,letters=z) mixtable mixtable=data.frame(col1=x,col2=y,letters=z) mixtable z letters mean='a' mean mean(1) rm(mean) mean(1) letters='A' letters rm(letters) letters mixtable mixtable$col1 mixtable$col2 mixtable$letters mean(mixtable$col2) mixtable[,3] mixtable[,2] mixtable[3,2] mixtable[3][2] mixtable[3,2] mixtable[2:3,2] mixtable[2:3,2:3] colnames(mixture) colnames(mixtable) x y y[2] y[2,] mixtable[2:3] mixtable[2] y[2,] y[0] y[2:3] y[c(1,3)] y c(1,3) y[(1,3)] y[1,3] y[c(1,3)] str(y) y=x*2 rownames(mixtable) rownames(mixtable)=c('row1','row2','row3') mixtable seq(10,20,by=2) seq(10,20,by=2.01) mixtable[1,] mixtable[,1] mixtable[1,1] mixtable['row1',] mixtable['row1','col1'] mixtable['row1',c('col1',letters')] ' mixtable['row1',c('col1','letters')] mixtable['row1',]$col2 mixtable['row1',c('col2')] study1file="~/meetings_workshops/Rmodeling/data/studyDataOneClean.csv" ?read.delim read.delim(study1file) ?read.table read.table(study1file) read.delim(study1file) ?read.table study1file="~/meetings_workshops/Rmodeling/data/studyDataOneClean.csv" system('ls') system('ls -lt') study1file study1file="~/meetings_workshops/Rmodeling/data/studyDataOneClean.csv" ?read.table read.table("~/meetings_workshops/Rmodeling/data/studyDataOneClean.csv")  read.delim("~/meetings_workshops/Rmodeling/data/studyDataOneClean.csv") MusicalTempoData=read.delim("~/meetings_workshops/Rmodeling/data/studyDataOneClean.csv") x=read.delim("~/meetings_workshops/Rmodeling/data/studyDataOneClean.csv") str(x) MusicTempoData=read.delim(study1file) str(MusicalTempoData) ?read.delim MusicTempoData=read.delim(study1file,row.names=1) str(MusicalTempoData) str(MusicTempoData) MusicTempoData=read.delim(study1file,row.names=1) MusicTempoData=read.delim(study1file,row.names=1) MusicTempoData=read.delim(study1file,row.names=1) str(MusicTempoData) MusicTempoData MusicTempoData['Chicago',] MusicTempoData['Chicago',]$PopDensity MusicTempoData['Chicago',2] MusicTempoData[1:5,2] MusicTempoData[,2] mean(MusicTempoData[,2]) mean(MusicTempoData[,'PopDensity']) mean(MusicTempoData$PopDensity) colMeans(MusicTempoData) str(MusicTempoData) MusicTempoData=read.delim(study1file) str(MusicTempoData) colMeans(MusicTempoData) MusicTempoData[,-1] MusicTempoData[,-(1:2)] colMeans(MusicTempoData[,-1]) ?source study1file="~/meetings_workshops/Rmodeling/data/studyDataOneClean.csv" study3file="~/meetings_workshops/Rmodeling/data/study3Opera.csv" # Once you have set the working directory, you do not need the full path: study1file="studyDataOneClean.csv" study3file="study3Opera.csv" NatIntelligibilityFile='~/meetings_workshops/Rmodeling/data/Nat Data.csv' read.delim(study1file) read.table(study1file,sep='\t',header=TRUE) read.csv(study3file) MusicTempoData=read.delim(study1file,row.names=1) mean(MusicTempoData$PopDensity) colmeans(MusicTempoData) colmeans(MusicTempoData[,-1]) getwd() source('~/meetings_workshops/Rmodeling/Rbasics.r') head(MusicTempoData) head(MusicTempoData,11) plot(AverageHigh~AverageLow,data=MusicTempoData) plot(MusicTempoData$AverageHigh,MusicTempoData$AverageLow) MusicTempoData$AverageHigh MusicTempoData$AverageLow source('~/meetings_workshops/Rmodeling/Rbasics.r') source('~/meetings_workshops/Rmodeling/Rbasics.r') MusicTempoData$Size=MusicTempoData$Population/MusicTempoData$PopDensity MusicTempoData$Population/MusicTempoData$PopDensity MusicTempoData$Size=MusicTempoData$Population/MusicTempoData$PopDensity head(MusicTempoData,11) mean(MusicTempoData) mean(MusicTempoData$Tempo,MusicTempoData$PopDensity) mean(c(MusicTempoData$Tempo,MusicTempoData$PopDensity)) c(MusicTempoData$AverageHigh,MusicTempoData$AverageLow) c(1,3,5) MusicTempoData[,4:5] rowMeans(MusicTempoData[,4:5]) study1file study3file ?apply ?options options('digits') options(digits=12) colmeans(MusicTempoData[,-1]) colMeans(MusicTempoData[,-1]) colMeans(MusicTempoDatA) colMeans(MusicTempoData) ?options options(max.print=10000000) colMeans(MusicTempoData) options(digits=7) colMeans(MusicTempoData) apply(MusicTempoData,2,sd) ?apply mapply(MusicTempoData,sd) mapply(sd,MusicTempoData) mapply(mean,MusicTempoData) plot(MusicTempoData$AverageHigh,MusicTempoData$AverageLow) plot(MusicTempoData$AverageHigh,MusicTempoData$AverageLow) identify(MusicTempoData$AverageHigh,MusicTempoData$AverageLow,rownames(MusicTempoData)) plot(MusicTempoData$AverageHigh,MusicTempoData$AverageLow,pch=rownames(MusicTempoData)) plot(MusicTempoData$AverageHigh,MusicTempoData$AverageLow,xlab='High Temperature (F)',ylab='Low Temperature (F)') x=c(1,2) x=c(First=1,Second=2) x names(x) y=c(First=1,Second=2) x y rbind(x,y) source('~/meetings_workshops/Rmodeling/Rbasics.r') source('~/meetings_workshops/Rmodeling/Rbasics.r') subset(study2,Gender=='M') plot(tessitura~Age,data=subset(study2,Gender=='M')) plot(tessitura~Age,data=subset(study2,Gender=='M'),col='blue') points(tessitura~Age,data=subset(study2,Gender=='F'),col='red') plot(1:16,pch=1:16) plot(1:32,pch=1:32) ?install ?install.packages ?mapply ?mapply save.history('~/meetings_workshops/Rmodeling/OSU/history/7May.txt') savehistory('~/meetings_workshops/Rmodeling/OSU/history/7May.txt') savehistory('~/meetings_workshops/Rmodeling/OSU/history/hist7May.txt')