head(faithful) #shows only the first lines of the dataset faithful #shows the whole dataset duration = faithful$eruptions waiting = faithful$waiting #data in the column labeled eruptions (/waiting) is stored in a new variable duration (/waiting) hist_duration = hist(duration,breaks=20,freq=FALSE,xlab="eruption duration") hist_waiting = hist(waiting,breaks=20,freq=FALSE,xlab="waiting time") #histograms are plotted plot(duration,waiting,xlab="eruption duration", ylab="waiting time") #scatter plot cor(duration, waiting) #empirical correlation