Dogs | R Documentation |
Data for Exercise 2.88
Dogs
A data frame/tibble with 20 observations on three variables
a factor with levels Beagle
,
Boxer
, Chihuahua
, Chow
, Dachshund
,
Dalmatian
, Doberman
, Huskie
, Labrador
,
Pomeranian
, Poodle
, Retriever
, Rotweiler
,
Schnauzer
, Shepherd
, Shetland
, ShihTzu
,
Spaniel
, Springer
, and Yorkshire
numeric ranking
a factor with levels 1992
, 1993
, 1997
,
and 1998
The World Almanac and Book of Facts, 2000.
Kitchens, L. J. (2003) Basic Statistics and Data Analysis. Pacific Grove, CA: Brooks/Cole, a division of Thomson Learning.
cor(Dogs$ranking[Dogs$year == "1992"], Dogs$ranking[Dogs$year == "1993"])
cor(Dogs$ranking[Dogs$year == "1997"], Dogs$ranking[Dogs$year == "1998"])
## Not run:
library(ggplot2)
ggplot2::ggplot(data = Dogs, aes(x = reorder(breed, ranking), y = ranking)) +
geom_bar(stat = "identity") +
facet_grid(year ~. ) +
theme(axis.text.x = element_text(angle = 85, vjust = 0.5))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.