# Load the diamonds dataset
data(diamonds)
# Create a histogram, assign to "plot1"
plot1 <- qplot(price,data=diamonds,binwidth=1000)
# Create a scatterplot
plot2 <- qplot(carat,price,data=diamonds)
# Arrange and display the plots into a 1x2 grid
multiPlot(plot1, plot2, ncols=2)
Run the code above in your browser using DataLab