using ggplot to plot cities in R

Hi, does someone know a good tutorial to map cities in ggplot? i have several cities within one country that I want to plot and add two additional variables to each city. Any help will be very much appreciated. Thank you! Sara

See the vignette in the {sf} package that uses the US state of North Carolina to illustrate this class of problem. Basically, your data and the geographic features for plotting are in the same data frame and you can plot using {ggplot2}. It's as powerful as the {sp} package it replaces and much easier to use.

Come back with a new question if you have trouble installing the {sf} package. It has some system dependencies that can be tricky.

Hi technocrat! thank you. I have tried this and I had problems installing the sf package, as you anticipated. But it seems now the problem is solved!

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.