Traffic | R Documentation |
Used by Tufte as an example of the importance of context, these data show the traffic fatality rates in New England in the 1950s. Connecticut increased enforcement of speed limits in 1956. In their full context, it is difficult to say if the decline in Connecticut traffic fatalities from 1955 to 1956 can be attributed to the stricter enforcement.
A data frame with 9 observations on the following 6 variables.
a year from 1951 to 1959
number of traffic deaths in Connecticut
deaths per 100,000 in New York
deaths per 100,000 in Connecticut
deaths per 100,000 in Massachusetts
deaths per 100,000 in in Rhode Island
Tufte, E. R. The Visual Display of Quantitative Information, 2nd ed. Graphics Press, 2001.
Donald T. Campbell and H. Laurence Ross. "The Connecticut Crackdown on Speeding: Time-Series Data in Quasi-Experimental Analysis", Law & Society Review Vol. 3, No. 1 (Aug., 1968), pp. 33-54.
Gene V. Glass. "Analysis of Data on the Connecticut Speeding Crackdown as a Time-Series Quasi-Experiment" Law & Society Review, Vol. 3, No. 1 (Aug., 1968), pp. 55-76.
data(Traffic)
gf_line(cn.deaths ~ year, data = Traffic)
if (require(tidyr)) {
TrafficLong <-
Traffic %>%
select(-2) %>%
gather(state, fatality.rate, ny:ri)
gf_line(fatality.rate ~ year, group = ~state, color = ~state, data = TrafficLong) %>%
gf_point(fatality.rate ~ year, group = ~state, color = ~state, data = TrafficLong) %>%
gf_lims(y = c(0, NA))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.