############################################### ## Author: Joshua M. Tebbs ## Date: 27 July 2016 ## Update: 15 March 2024 ## STAT 110 course notes: R Code Chapter 1 ############################################### # Figure 1.1 # Page 3 # Find data web site # Cut and paste data set into a notepad file # Save this file (e.g., birthweights.txt) to a folder on your laptop or desktop # Import the data from the folder # This creates a table (with each row corresponding to one infant) birth.weights = read.table("C:\\Users\\tebbs\\Documents\\texfiles\\Classes\\USC\\stat110\\s24\\data\\birthweights.txt",header=TRUE) # This creates a univariate data set (ignoring infant case number) birth.weights = birth.weights[,1] # extracts data from the table # Make histogram of the data hist(birth.weights,xlab="Birth weight (in grams)",ylab="Count",main="",col="lightblue",ylim=c(0,120))