AN INTRODUCTION TO R
The unique names of all 2000 companies are stored in a character vector R> class(Forbes2000[,"name"])
and the first element of this vector is R> Forbes2000[,"name"]
Because the companies are ranked, Citigroup is the world’s largest company according to the Forbes 2000 list. Further details on vectors and subsetting are given in Section 1.6.
Nominal measurements are represented by factor variables in R, such as the category of the company’s business segment
Objects of class factor and character basically differ in the way their values are stored internally. Each element of a vector of class character is stored as a character variable whereas an integer variable indicating the level of a factor is saved for factor objects. In our case, there are
different levels, i.e., business categories, which can be extracted by R> levels(Forbes2000[,"category"])
  
" Aerospace & defense "Banking" "Business services & supplies" "
As a simple summary statistic, the frequencies of the levels of such a factor variable can be found from
Aerospace & defense 19 Business services & supplies 70
The sales, assets, profits and market value variables are of type numeric, the natural data type for continuous or discrete measurements, for example
and simple summary statistics such as the mean, median and range can be found from