Get startedGet started for free

Datasets inside R

Welcome to the Clustering and classification chapter.

R has many (usually small) datasets already loaded in. There are also datasets included in the package installations. Some of the datasets are quite famous (like the Iris flower data) and they are frequently used for teaching purposes or to demonstrate statistical methods.

This week we will be using the Boston dataset from the MASS package. Let's see how it looks like!

This exercise is part of the course

Helsinki Open Data Science

View Course

Exercise instructions

  • Load the Boston dataset from MASS
  • Explore the Boston dataset. Look at the structure with str() and use summary() to see the details of the variables.
  • Draw the plot matrix with pairs()

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# access the MASS package
library(MASS)

# load the data
data("Boston")

# explore the dataset



# plot matrix of the variables

Edit and Run Code