R provides vectorized operations that allow performing calculations efficiently on entire vectors and matrices at once. Functions like addition, subtraction, multiplication, and division work element-wise across vectors of the same length. Matrix operations like multiplication can also be performed. R uses factors to represent categorical data, which are treated specially in modeling functions. Factors have levels and can be ordered. Random samples can be drawn from vectors and matrices constructed to represent categorical data.