save.image("C:\\Documents and Settings\\EmirB\\Desktop\\LDesktop\\Columbia\\Computational Statistics Course\\Lecture\\.RData") x = c(1:10) x x <- c(1:10) x x <- c(1:10); x mean(X) ls() mean(x) sequence(1,10,.5) sequence(1:10,.5) seq(1:10,.5) ?seq ?sequence ?seq seq(,10,by=.5) seq(1,10,by=.5) seq(1,10,by=.5) seq(from=1,to=10,by=.5) seq(from=1,to=10,by=.05) X=seq(from=1,to=10,by=.05) ls() x X rm(X) ls() history(100) getwd() help(options) options(digits=3) help(mean) ?mean x <- c(0:10, 50) xm <- mean(x) c(xm, mean(x, trim = 0.10)) x xm apropos("mean") ?kmeans RSiteSearch("foo") RSiteSearch("Robust") data() data(AirPassengers) names(AirPassengers) summary(AirPassengers) AirPassengers[1:5,] AirPassengers local({pkg <- select.list(sort(.packages(all.available = TRUE))) if(nchar(pkg)) library(pkg, character.only=TRUE)}) ?Desing ?Design utils:::menuInstallPkgs() library() mean(x) x mean=mean(x) mean conflicts() lds() ls() rm(mean) mean conflicts() xmean(mean(x) xmean=mean(x) data(mtcars) newdata = mtcars[order(mpg),] summary(mtcars) newdata = mtcars[order(mtcars$mpg),] mtcars[1:5,] newdata[1:5,] newdata <- mtcars[order(mtcars$mpg, -mtcars$cyl),] newdata[1:5,] newdata[1:10,] newdata = mtcars[order(mtcars$mpg),] # sort by mpg and cylnewdata <- mtcars[order(mtcars$mpg, mtcars$cyl),] newdata[1:10,] newdata[1:10,] newdata = mtcars[order(mtcars$mpg),] newdata[1:10,] data(mtcars) newdata[1:10,] newdata = mtcars[order(mtcars$mpg),] newdata[1:10,] summary(mtcars) newdata <- mtcars[order(mtcars$mpg, mtcars$cyl),] newdata attach(mtcars)aggdata <-aggregate(mtcars, by=list(cyl,vs),   FUN=mean, na.rm=TRUE)print(aggdata) attach(mtcars)aggdata <-aggregate(mtcars, by=list(cyl,vs),   FUN=mean, na.rm=TRUE)print(aggdata) attach(mtcars) aggdata <-aggregate(mtcars, by=list(cyl,vs),  FUN=mean, na.rm=TRUE) print(aggdata) summary(mtcars) aggregate(mtcars, by=list(cyl),  FUN=mean, na.rm=TRUE) aggregate(mtcars, by=list(vs),  FUN=mean, na.rm=TRUE) utils:::menuInstallPkgs() library(Rcmdr) growthcurve<- sqlQuery(channel = 1, select * from [GrowthCurve$]) growthcurve<- sqlQuery(channel = 1, select * from [GRWOTHCURVE$]) growthcurve<- sqlQuery(channel = 1, select * from [GROWTHCURVE$]) ?sqlQuery ls() eff eff[1:5,] eff[1:5,1:5] eff[1:5,1:10] summary summary(eff) names(eff) summary(eff[,c(8,11,12,13)]) eff$csex=as.factor(eff$nsex) eff$CSEX=as.factor(eff$NSEX) eff[1:5,c(5,19)] summary(eff[,c(5,19)]) summary(eff[,c("NSEX","CSEX")]) numSummary(eff[,c("AGE", "SLEEP", "SLEEP0", "SLPCHG")], groups=eff$STATUS, statistics=c("mean", "sd", "quantiles"), quantiles=c(0,.025, .25,.5,.75,.95,1)) names(eff) levels(eff$STATUS) levels(eff$CWEEK) levels(eff$NWEEK) sub= eff$NWEEK == 99 sub eff[sub,] eff[sub,] unique(eff$NWEEEK) unique(eff$NWEEK) summary(eff$NWEEK) sub= eff$WEEK == 99 sub eff1=eff[sub,] dim(eff) dim(eff1) unique(eff$WEEK) unique(eff1$WEEK) save.image("C:\\Documents and Settings\\EmirB\\Desktop\\LDesktop\\Columbia\\Computational Statistics Course\\Lecture\\.RData") eff1 summary(eff1) eff1$TRT=as.factor(eff1$RXGP) dim(eff1) names(eff1) eff2=eff1[,-c("RXGP","NSEX")] eff2=eff1[,-c(4,5)] dim(eff2) names(eff2) save.image("C:\\Documents and Settings\\EmirB\\Desktop\\LDesktop\\Columbia\\Computational Statistics Course\\Lecture\\.RData")