R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

library(kableExtra)
library(tidyverse)
## -- Attaching packages ---------------------------------------------------------------------------------------------- tidyverse 1.2.1 --
## v ggplot2 3.1.1       v purrr   0.3.2  
## v tibble  2.1.1       v dplyr   0.8.0.1
## v tidyr   0.8.3       v stringr 1.4.0  
## v readr   1.3.1       v forcats 0.4.0
## -- Conflicts ------------------------------------------------------------------------------------------------- tidyverse_conflicts() --
## x dplyr::filter()     masks stats::filter()
## x dplyr::group_rows() masks kableExtra::group_rows()
## x dplyr::lag()        masks stats::lag()
library(knitr)
options (kableExtra.latex.load_packages = FALSE)
dt <- mtcars[1:5, 1:6]
summary(dt)
##       mpg             cyl         disp             hp       
##  Min.   :18.70   Min.   :4   Min.   :108.0   Min.   : 93.0  
##  1st Qu.:21.00   1st Qu.:6   1st Qu.:160.0   1st Qu.:110.0  
##  Median :21.00   Median :6   Median :160.0   Median :110.0  
##  Mean   :20.98   Mean   :6   Mean   :209.2   Mean   :119.6  
##  3rd Qu.:21.40   3rd Qu.:6   3rd Qu.:258.0   3rd Qu.:110.0  
##  Max.   :22.80   Max.   :8   Max.   :360.0   Max.   :175.0  
##       drat             wt       
##  Min.   :3.080   Min.   :2.320  
##  1st Qu.:3.150   1st Qu.:2.620  
##  Median :3.850   Median :2.875  
##  Mean   :3.576   Mean   :2.894  
##  3rd Qu.:3.900   3rd Qu.:3.215  
##  Max.   :3.900   Max.   :3.440
options(digits = 2)
kable(dt)
mpg cyl disp hp drat wt
Mazda RX4 21 6 160 110 3.9 2.6
Mazda RX4 Wag 21 6 160 110 3.9 2.9
Datsun 710 23 4 108 93 3.8 2.3
Hornet 4 Drive 21 6 258 110 3.1 3.2
Hornet Sportabout 19 8 360 175 3.1 3.4
dt %>%
  kable() %>%
  kable_styling()
mpg cyl disp hp drat wt
Mazda RX4 21 6 160 110 3.9 2.6
Mazda RX4 Wag 21 6 160 110 3.9 2.9
Datsun 710 23 4 108 93 3.8 2.3
Hornet 4 Drive 21 6 258 110 3.1 3.2
Hornet Sportabout 19 8 360 175 3.1 3.4