Learn R Programming

Lock5withR

This R Companion to Statistics: Unlocking the Power of Data by Lock, Lock, Lock, Lock, and Lock provides

  • a companion text
  • an R package (Lock5withR)

Companion Text

  • Lock5 with R, a companion to Statistics: Unlocking the Power of Data

is available as a PDF

  • The authors are Randall Pruim and Lana Park.

R Package

The Lock5withR package can be installed from github using

devtools::install_github("rpruim/Lock5withR")

This package contains all of the data sets used in the package and the locket() function which can be used to run any of 417 code chunks from the campanion.

For example:

require(Lock5withR)
require(mosaic)
locket("Example2.11")
#> 
#> 
#> 	locket(Example2.11)
#> 	------ ~~~~~~~~~~~
#> 
#> > ICU20 <- subset(ICUAdmissions, Age == "20")
#> 
#> > mean( ~ HeartRate, data = ICU20)
#> [1] 82.2
#> 
#> > median( ~ HeartRate, data = ICU20)
#> [1] 80
#> 
#> > ICU55 = subset(ICUAdmissions, Age == "55")
#> 
#> > mean( ~ HeartRate, data = ICU55)
#> [1] 108.5
#> 
#> > median( ~ HeartRate, data = ICU55)
#> [1] 106

Relationship to Lock5Data

The Locks have created an R package called Lock5Data that contains the data sets from their text. Some of these data sets have been modified in Lock5withR to make them easier to use with R. Modified data sets include the following:

AllCountries    BikeCommute      BodyTemp50       CaffeineTaps 
CarbonDioxide   CO2              EmployedACS      Flight179 
GPAGender       ICUAdmissions    MiamiHeat        MindsetMatters 
NFLScores2011   NutritionStudy   RestaurantTips   RetailSales 
SalaryGender    SampCountries    SandP500         SleepStudy 
SpeedDating     StudentSurvey    USStates         WaterTaste 
Wetsuits

Typically changes involved the inclusion of additional variables with better encodings. Somtimes variables are replaced. In the case of CO2 the data set has been renamed AtmosphericCO2 to avoid a name collision with a data set in the datasets package.

The locket() function is only available in Lock5withR.

Copy Link

Version

Install

install.packages('Lock5withR')

Monthly Downloads

37

Version

1.2.2

License

GPL-2

Maintainer

Last Published

December 22nd, 2015

Functions in Lock5withR (1.2.2)

ACS

American Community Survey
BaseballHits

Baseball Hits
BaseballTimes

Baseball Game Times
MindsetMatters

Mindset Matters
HockeyPenalties

Hockey Penalties
HoneybeeCircuits

Honeybee Circuits
APMultipleChoice

AP Multiple Choice
ImmuneTea

Immune Tea
NBAPlayers2011

NBA Players data for 2010-11 Season
OlympicMarathon

2008 Olympic Men's Marathon
April14Temps

April 14th Temperatures
MastersGolf

Masters Golf Scores
PizzaGirl

Pizza Girl Tips
CricketChirps

Cricket Chirps
HomesForSale

Home for Sale
QuizPulse10

Quiz vs Lecture Pulse Rates
SleepStudy

Sleep Study
FishGills3

FishGills3
StatisticsPhD

Statistics PhD Programs
MustangPrice

Mustang Prices
MalevolentUniformsNHL

Malevolent Uniforms NHL
CompassionateRats

Compassionate Rats
GPAGender

GPA and Gender
HappyPlanetIndex

Happy Planet Index
SalaryGender

Salary and Gender
StudentSurvey

Student Survey Data
FloridaLakes

Florida Lakes
CommuteStLouis

Comute times in St. Louis
BodyTemp50

Body Temperatures
HoneybeeWaggle

Honeybee Waggle
SpeedDating

Speed Dating
OttawaSenators

Ottaw Senators hockey team
Lock5Data-package

Lock5 Datasets
RestaurantTips

Restaurant Tips
StressedMice

Stressed Mice
ToenailArsenic

Toenail Arsenic
NBAStandings

NBA 2010-11 Regular Season Standings
BodyFat

Body Measurements
FatMice18

Fat Mice 18
StockChanges

Stock Changes
ExerciseHours

Exercise Hours
HollywoodMovies2011

Hollywood Movies in 2011
SampCountries

AllCountries
MinistersRum

Ministers and Rum
RetailSales

Retail Sales
HomesForSaleCA

Home for Sale in California
CAOSExam

CAOS Exam Scores
HomesForSaleCanton

Homes for sale in Canton, NY
SleepCaffeine

Sleep Caffeine
Flight179

Flight times
Benford

Benford data
USStates

US State Data
SandwichAnts

Sandwich Ants
InkjetPrinters

Inkjet Printers
WaterTaste

WaterTaste
HomesForSaleNY

Home for Sale in New York
MalevolentUniformsNFL

Malevolent Uniforms NFL
GlobalInternet

Global Internet Usage
MiamiHeat

Miami Heat basketball
CaffeineTaps

Caffeine Taps
NutritionStudy

Nutrition Study
BikeCommute

Bike Commute
Cereal

Breakfast Cereals
StatGrades

Statistics Exam Grades
ICUAdmissions

Intensive Care Unit Admissions
CocaineTreatment

Coacaine Treatment
EmployedACS

Employed in American Community Survey
LightatNight

Light at Night for Mice
CommuteAtlanta

Commute Atlanta
SandwichAnts2

Sandwich Ants - Part 2
MentalMuscle

Mental Muscle
StorySpoilers

Story Spoilers
LifeExpectancyVehicles

Life Expectancy and Vehicle Registrations
ElectionMargin

Election Margin
FishGills12

FishGills12
AllCountries

AllCountries
BootAtlantaCorr

Bootstrap Correlations for Atlanta Commutes
NFLScores2011

NFL Game Scores in 2011
DogOwner

Dog/Owner matches
MammalLongevity

Mammal Longevity
TenCountries

Ten Countries
MarriageAges

Marriage Ages
TextbookCosts

Textbook Costs
WaterStriders

Water Striders
SkateboardPrices

Skateboard Prices
Smiles

Smiles
RockandRoll

Rock & Roll Hall of fame
TrafficFlow

Traffic Flow
SandP500

S \& P 500 Prices
ManhattanApartments

Manhattan Apartment Prices
Digits

Digit counts
RandomP50N200

Simulated proportions
HotDogs

Hot Dog Eating Contest
AtmosphericCO2

Atmospheric carbon dioxide levels by year
locket

Display or execute a snippet of R code
ColaCalcium

Cola Calcium
FacebookFriends

Facebook Friends
Wetsuits

Wetsuits