ComeçarComece de graça

Insight through aesthetics

Adding a map to your plot of sales explains some of the structure in the data: there are no house sales East of the Willamette River or on the Oregon State University campus. This structure is really just a consequence of where houses are in Corvallis; you can't have a house sale where there are no houses!

The value of displaying data spatially really comes when you add other variables to the display through the properties of your geometric objects, like color or size. You already know how to do this with ggplot2 plots: add additional mappings to the aesthetics of the geom.

Let's see what else you can learn about these houses in Corvallis.

NOTE: Many exercises in this course will require you to create more than one plot. You can toggle between plots with the arrows at the bottom of the 'Plots' window and zoom in on a plot by clicking the arrows on the tab at the top of the 'Plots' window.

Este exercício faz parte do curso

Visualizing Geospatial Data in R

Ver curso

Exercício interativo prático

Experimente este exercício completando este código de exemplo.

# Map color to year_built
ggmap(corvallis_map) +
  geom_point(aes(lon, lat), data = sales)
Editar e executar o código