6 comments
This is such a cool package, but the maps look completely unpresentable without decent projections! I know it’s something that’s been brought up before in the comments of the blog and that it’s a complicated issue, but whenever I see these posts on R-bloggers I think “ooh, that looks so great, I wish I could use it but I couldn’t show those maps to anyone so distorted”.
Gregor, thanks for taking the time to comment. You can easily add any projection to any map that choroplethr produces by adding ggplot2’s coord_map() – literally just type “coord_map()”. I haven’t added a default projection to choroplethr yet for two reasons
1. It looks like ggplot2 has a bug for projections on world maps.
2. For all US maps I would like to use the Albers projection, which is what I believe the US Census Bureau uses. But I’m not sure what parameters I should provide to it. Also, should those pamaters change for the insets of Alaska and Hawaii, and zooms of small regions such as San Francisco above? Ideally I would not be making up numbers myself to give to it, but would use some generally accepted values. But I haven’t found a source for that yet.
The reason I don’t manually add a projection to the maps above is that I wanted to focus on the code. I could add simply add “+ coord_map()” myself, but I think that it would just be masking the fact that I haven’t satisfactorily answered (2) myself, and incorporated it elegently into the package.
If you can point me in the direction of answering (2) above, please let me know.
That’s great! I was under the impression that there was some conflict with `coord_map`. Unfortunately I can’t help with 2, I don’t know much about projections.
IMHO, you should add some projections manually in your blog posts… if you show the code and mention it in the text you’re not hiding anything, and it would make the demo results *much* more appealing.
Gregor, thanks for the feedback. I have updated this post based on your feedback, and will follow your advice for subsequent posts as well.
Thanks! I think that you will like Thursday’s post 🙂