Univariate data
In this chapter, we are going to deal with univariate data, which is a fancy way of saying samples of one variable—the kind of data that goes into a single R vector. Analysis of univariate data isn't concerned with the why questions—causes, relationships, or anything like that; the purpose of univariate analysis is simply to describe.
In univariate data, one variable—let's call it x—can represent categories like soy ice cream flavors, heads or tails, names of cute classmates, the roll of a die, and so on. In cases like these, we call x a categorical variable.
> categorical.data <- c("heads", "tails", "tails", "heads")
Categorical data is represented, in the preceding statement, as a vector of character type. In this particular example, we could further specify that this is a binary or dichotomous variable, because it only takes on two values, namely, "heads" and "tails."
Our variable x could also represent a number like air temperature, the prices of financial instruments...