knitr::opts_chunk$set(echo = TRUE) library(tidyverse) library(openintro)
One of the major differences between base R and Tidyverse is the use of the pipe operator, %>%
, from the magrittr
package. Starting with R version 4.0, there is a native (i.e. base R) pipe operator, |>
. However, it behaves differently from the magrittr
pipe. For the problems below, use the magrittr
pipe for the Tidyverse problems and either the native pipe or no pipe for base R.
Calculate the average number of study hours per week with base R and Tidyverse.
#INSERT YOUR CODE HERE
Calculate the standard deviation for both variables with base R and Tidyverse.
#INSERT YOUR CODE HERE
For the plots below, use the ggplot2
package from the Tidyverse.
Sketch a histogram for the study_hours variable.
#INSERT YOUR CODE HERE
Sketch a boxplot for each variable.
#INSERT YOUR CODE HERE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.