Robinlovelace / Creating-maps-in-R

Introductory tutorial on graphical display of geographical information in R.
https://cran.r-project.org/other-docs.html
568 stars 341 forks source link

Add tmaptools for read_osm fun #51

Closed poldham closed 6 years ago

poldham commented 6 years ago

Dear Robin,

Very many thanks for this really helpful tutorial. I am working from the rproj file which may be a bit out of date, but I think needs a quick corr in the chunk at line 750

You load tmap at the start of the chunk but it seems that read_osm has moved to tmaptools. I'm using tmap 1.11 and the fun is not in that version. I found online documentation referring to read_osm in v.tmap1.6-1 suggesting it has moved. The chunk runs fine with library(tmaptools).

Many thanks again for this tutorial.

All the best,

Paul

Robinlovelace commented 6 years ago

Thanks for your feedback Paul, I'll take a look.

Robinlovelace commented 6 years ago

I think I've fixed it - let me know if you've any further comments.

On a related note if you found this tutorial useful, you may also be interested in the in-progress open access book Geocomputation with R, which to some extent builds on this content. I particularly recommend chapter 2 which is essentially finished. Any feedback on that welcome: https://geocompr.robinlovelace.net/spatial-class.html

poldham commented 6 years ago

Thanks Robin, Finished the tutorial and it is incredibly useful… along with the bonus vignettes. My comment would be maybe to add a chunk at the start with the install packages and a chunk for the load libraries. As it is a long and detailed tutorial I found after restarting the R session that I was lost on what libraries I needed (e.g.png and raster later on).

I had spotted the book draft repo and look forward to reading through it and commenting. Also realised that I own a copy of the very useful Efficient R Programming!

On 29 Dec 2017, at 13:49, Robin notifications@github.com wrote:

I think I've fixed it - let me know if you've any further comments.

On a related note if you found this tutorial useful, you may also be interested in the in-progress open access book Geocomputation with R, which to some extent builds on this content. I particularly recommend chapter 2 which is essentially finished. Any feedback on that welcome: https://geocompr.robinlovelace.net/spatial-class.html https://geocompr.robinlovelace.net/spatial-class.html — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Robinlovelace/Creating-maps-in-R/issues/51#issuecomment-354448289, or mute the thread https://github.com/notifications/unsubscribe-auth/AKdA8LiM6zAl0ogbwyfqJVyck8YTHEdqks5tFO3-gaJpZM4RPGyd.

geneorama commented 6 years ago

Although I appreciate the many online tutorials I've found online over the years, I was often frustrated by having to install libraries throughout the code. So, I wrote a simple function called loadinstall_libraries to load or (only if necessary) install and load libraries. It also helped when I was consulting and wanted to share results with clients. Using it consistently in my scripts also helps when upgrading R every six months.

Now I only get stuck by those tutorials that load unpublished data halfway through the example! Thankfully, Robin never does that.

@poldham you might find it useful. You could also just name the function "library" so that it gets called whenever you hit a library call.