Univariate descriptive statistics

Descriptive statistics can be most easily obtained in R using the summary() function.  The summary command is generic in the sense that object or "argument" of the function could be anything.  If the argument is a data frame, summary() returns descriptive statistics for each variable, whereas if the argument is a single variable, summary() just returns the descriptive statistics for that variable.

attach(scanvote)
summary(scanvote) 

Individual descriptive statistics can be obtained using the following, self-explaining functions:

mean(), median(), max(), min(), range(), var(), sd(), quantile(), fivenum(), length(), which.max(), which.min()

Descriptive statistics for individual groups of observations can be obtained by the tapply() function.  For example,

tapply(Yes, Country, mean)

applies the mean() function to observations from each reach of Summit Cr., while

tapply(Yes, Country, summary)

applies the summary() function to each of those groups.