var_cars | R Documentation |
This is a transformation of the mtcars
dataset from R to produce a small
dataset with each of the fundamental datatypes: logical, factor, ordered,
integer, and double. Most of the transformations are obvious, but two are
noteworthy:
For the unordered factor, the country of the car manufacturer is obtained
based on the row names of mtcars
. This var_cars
version does not have row names.
For the ordered factor, gears 3, 4, and 5 are encoded as 'three', 'four', and 'five', respectively. The text labels make it explicit that the variable is ordinal, yet the number names make the order crystal clear.
Here is the original description of the mtcars
dataset:
The data was extracted from the 1974 Motor Trend US magazine, and comprises fuel consumption and 10 aspects of automobile design and performance for 32 automobiles (1973–74 models).
var_cars
A tibble with 32 observations on 12 variables.
double
: Miles/(US) gallon
integer
: Number of cylinders
double
: Displacement (cu.in.)
double
: Gross horsepower
double
: Rear axle ratio
double
: Weight (1000 lbs)
double
: 1/4 mile time
logical
: Engine (0 = V-shaped, 1 = straight)
logical
: Transmission (0 = automatic, 1 = manual)
ordered
: Number of forward gears
integer
: Number of carburetors
factor
: Country of car manufacturer
Henderson and Velleman (1981) comment in a footnote to Table 1: 'Hocking (original transcriber)'s noncrucial coding of the Mazda's rotary engine as a straight six-cylinder engine and the Porsche's flat engine as a V engine, as well as the inclusion of the diesel Mercedes 240D, have been retained to enable direct comparisons to be made with previous analyses.'
Henderson and Velleman (1981), Building multiple regression models interactively. Biometrics, 37, 391–411.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.