50 likes | 208 Views
Descriptive Exploratory Data Analysis II. Jagdish S. Gangolly State University of New York at Albany. Data Manipulation:. Matrices: bind rows ( rbind ), bind columns ( cbind ) Arrays: rowMeans, colMeans, rowSums, colSums, rowVars, colVars,… apply(data, dim, function,…)
E N D
Descriptive Exploratory Data Analysis II Jagdish S. Gangolly State University of New York at Albany
Data Manipulation: • Matrices: bind rows (rbind), bind columns (cbind) • Arrays: rowMeans, colMeans, rowSums, colSums, rowVars, colVars,… • apply(data, dim, function,…) • attach(framename):permits you to refer to variables without cumbersome notations. You can detach the frame when done. • function (x) {function definition}:To define your own functions • rm(comma-separated S-Plus objects):To remove objects
S-Plus Graphics • motif( ) : To open a graphics window. Each time you invoke this, a new graphics window is opened. • dev.off() : Close the most recent graphics device opened. • graphics.off() : Close all graphics devices. • plot(comma-separated variables, plot character)
Trellis Graphics I • A matrix of graphs Example: >par(mfrow=c(2,2)) # 2 X 2 matrix of figures >x <- 1:100/100:1 >plot(x) # plot cell (1,1) >plot(x, type=“l”) # plot cell (1,2) line >hist(x) # plot cell (2,1) histogram >boxplot(x) # plot cell (2,2) boxplot
Trellis Graphics II Syntax: Dependent variable ~ explanatory variable |conditioning variable Data set Output: >trellis.device(motif) >dev.off() or >graphics.off()