knitr::opts_chunk$set(echo = TRUE, warning=FALSE)
suppressWarnings(suppressMessages(suppressPackageStartupMessages(library(ggplot2))))

Introduction

This example is adapted from data supplied by https://www.statcan.gc.ca.

Analysis

Input the data

The weights (to the nearest tenth of a kilogram) of 30 students were measured and recorded as follows:

dat <- c(59.2, 61.5, 62.3, 61.4, 60.9, 59.8,
         60.5, 59.0, 61.1, 60.7, 61.6, 56.3,
         61.9, 65.7, 60.4, 58.9, 59.0, 61.2,
         62.1, 61.4, 58.4, 60.8, 60.2, 62.7,
         60.0, 59.3, 61.9, 61.7, 58.4, 62.2)

Make the plots

library(statshelpR)
print(stem_leaf_plot(dat))

Summary

Note the location of the decimal in this example. The numbers beyond the vertical bar are the values in tenths of kg.



jrminter/statshelpR documentation built on May 2, 2020, 12:08 a.m.