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:
summary(cars)
## speed dist
## Min. : 4.0 Min. : 2.00
## 1st Qu.:12.0 1st Qu.: 26.00
## Median :15.0 Median : 36.00
## Mean :15.4 Mean : 42.98
## 3rd Qu.:19.0 3rd Qu.: 56.00
## Max. :25.0 Max. :120.00
You can also embed plots, for example:
Note that the echo = FALSE parameter was added to the
code chunk to prevent printing of the R code that generated the
plot.
This section will show you…
This is the data set that we found
This analysis shows us that we had the right assumptions. We used google to find a lot of our data.
Here is a bolded word, an italic word, a
R object, a superscript2, and a
subscript2
library(tidyverse)
## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.2 ──
## ✔ ggplot2 3.3.6 ✔ purrr 0.3.4
## ✔ tibble 3.1.8 ✔ dplyr 1.0.10
## ✔ tidyr 1.2.0 ✔ stringr 1.4.1
## ✔ readr 2.1.2 ✔ forcats 0.5.2
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
mtcars %>% ggplot(aes(x = mpg, y = hp)) + geom_point()
xbar <- 2
se <- 1.3
The 95% confidence interval for the mean is (-0.548, 4.548)
# Nicely format column names
my.table <- mtcars[1:5, 1:4]
colnames(my.table) <- c("MPG", "Cylinders",
"Displacement", "Horsepower")
knitr::kable(my.table, digits = c(0, 1, 0, 0, 0),
align = c('l', 'r', 'r', 'r', 'r'),
row.names = TRUE)
| MPG | Cylinders | Displacement | Horsepower | |
|---|---|---|---|---|
| Mazda RX4 | 21 | 6 | 160 | 110 |
| Mazda RX4 Wag | 21 | 6 | 160 | 110 |
| Datsun 710 | 23 | 4 | 108 | 93 |
| Hornet 4 Drive | 21 | 6 | 258 | 110 |
| Hornet Sportabout | 19 | 8 | 360 | 175 |
flextable::flextable(my.table, cwidth = 1.15)
MPG | Cylinders | Displacement | Horsepower |
21.0 | 6 | 160 | 110 |
21.0 | 6 | 160 | 110 |
22.8 | 4 | 108 | 93 |
21.4 | 6 | 258 | 110 |
18.7 | 8 | 360 | 175 |