Report for the Cars and Pressure Datasets

Final Project for the Course on Reproducible Templates for Analysis and Dissemination by Prof. Mellinda Higgins of Emory University

John King’athia Karuitha

Sunday, May 23, 2021

Background

In this short report, I will work with the pressure and cars datasets that are inbuilt in R. I will start by plotting the pressure dataset, and then capture the top six (6) rows of the cars dataset. I will also use an appropriate theme to colour the fonts of my graph and tables. Finally, I will publish the report to rpubs.

A bulleted list of 3 or more items (either numbered or unnumbered)

The mpg dataset has a list of car models. Some four examples are given below.

  • Audi

    • Manual
    • Auto
  • Chevrolet

    • 2 seater
    • Compact
  • Dodge

  • Ford

Plot of the Pressure Dataset

In this section I plot the temperature versus pressure based on the pressure dataset. You can over your mouse cursor over the points to see the corresponding values.

ggplotly(pressure %>% 
    
    ggplot(mapping = aes(x = temperature, y = pressure, col = factor(temperature))) + 
    
    geom_point(shape = 1, stroke = 3, size = 4) + 
    
    ggthemes::theme_fivethirtyeight() + 
    
    labs(title = "Plot of Temp vs. Pressure", 
         x = "Temperature", y = "Pressure",
         caption = "John Karuitha, 2020, using R, Tidyverse, Plotly Packages") + 
    
    theme(legend.position = "none")) 

A table of the top 6 rows of the built-in ‘cars’ dataset

head(cars) %>% 
knitr::kable(caption = "Top 6 Rows of the Cars Dataset", booktabs = TRUE) %>% 
kableExtra::kable_styling(bootstrap_options = "striped", full_width = FALSE)
Top 6 Rows of the Cars Dataset
speed dist
4 2
4 10
7 4
7 22
8 16
9 10