SMAC-Group / ds

:notebook: This book is currently under development and has been designed as a support for students who are following (or are interested in) courses that provide the basic knowledge to master "statistical programming" with R. Compiled textbook:
http://r.smac-group.com
7 stars 4 forks source link

Add other example to map section + ref #20

Open stephaneguerrier opened 7 years ago

stephaneguerrier commented 7 years ago

Here is another example we could add to map example:

library(ggmap)
places <- c("Old main, penn state", "Beaver staduim, penn state")
places_coord <- geocode(places)
pennstate <- get_googlemap("Creamery, Penn state university", zoom = 15, maptype = 'satellite',
                           markers = places_coord)
route <- route(places[1], places[2], mode = "walking")
ggmap(pennstate) + geom_path(
  aes(x = startLon, y = startLat),  colour = "red", size = 1.5,
  data = route, lineend = "round"
)

It should like this:

screen shot 2017-09-26 at 10 58 16 am

Also we should add a ref to (ggmap : Spatial Visualization with ggplot2)[http://stat405.had.co.nz/ggmap.pdf]

Here is another example I have made:

screen shot 2017-10-11 at 11 26 23 pm screen shot 2017-10-11 at 11 26 30 pm