{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE)
Enter this data set, giving it the name “tomatodata”: ```{r} tomatodata
<- c( 6.3, 7.2, 6.8, 5.4, 6.5, 5.9, 6.6, 6.5, 7.1, 7.0)
Take the average:
```{r}
mean(tomatodata)
Take the median: ```{r} median(tomatodata)
Find the standard deviation:
```{r}
sd(tomatodata)
Find the largest number: ```{r} max(tomatodata)
Find the smallest number:
```{r}
min(tomatodata)
Find the 30th percentile: ```{r} quantile(tomatodata, 0.30)
Find the 5-number summary (min, 25th percentile, median, 75th percentile, max):
```{r}
quantile(tomatodata)
Find the interquartile range (75th percentile minus the 25th percentile) ```{r} IQR(tomatodata)
Make a histogram:
```{r}
hist(tomatodata)
Make a box plot (display the five number summary): ```{r} boxplot(tomatodata)
Make a horizontal box plot:
```{r}
boxplot(tomatodata, horizontal=TRUE)
Make the output say Tomato data is awesome!
{r} print("Tomato data is awesome!")
Make the output say
The mean tomato size is 6.53
{r} print(paste("The mean tomato size is", mean(tomatodata), sep = ""))
Install the tidyverse package in the console below markdown ```{r}
install.packages(“tidyverse”)
Load the tidyverse library and diamonds data into the markdown
```{r}
library(tidyverse)
Load the mtcars data ```{r} data(mtcars)
Preview the first 6 rows
```{r}
head(mtcars)
Use tidyverse language to make a histogram of any numeric variable in mtcars: ```{r} ggplot(data = mtcars, aes(x = mpg)) + geom_histogram()
```