Exploratory Data Analysis and Graphics

Princeton University Press eBooks · 2008

This chapter covers both the practical details and the broader philosophy of (1) reading data into R and (2) doing exploratory data analysis, in particular graphical analysis.To get the most out of the chapter you should already have some basic knowledge of R's syntax and commands (see the R supplement of the previous chapter).* "Bible Codes", where people find hidden messages in the Bible, illustrate an extreme form of data-dredging.Critics have pointed out that similar procedures will also detect hidden messages in War and Peace or Moby Dick (McKay et al., 1999).† Or you should apply a post hoc procedure [see ?TukeyHSD and the multcomp package in R] that corrects for the fact that you are testing a pattern that was not suggested in advancehowever, even these procedures only apply corrections for a specific set of possible comparisons, not all possible patterns that you could have found in your data.* Your computer may be set up to open comma-delimited (.csv) files in Excel, but underneath they are just text files.* If you don't know what a package is, go back and read about them in the R supplement for Chapter ??. * the + symbol is called a "binary operator" because it is used to combine two values * Matrices and data frames can appear identical but behave differently.If x is a data frame, either colnames(x) or names(x) will tell you the column names.If x has a column called a, either x$a or x[["a"]] or x[,"a"] will retrieve it.If x is a matrix, you must use colnames(x) to get the column names and x[,"a"] to retrieve a column (the other commands will give errors).Use is.data.frameor class to tell matrices and data frames apart.

Read the paper · More papers on PaperTik