Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # IMPORT CSV DATA
- sf_crime <- read_csv('sf_crime-data-2017.csv'
- ,col_names = c('lon'
- ,'lat'
- )
- ,skip = 1
- )
- # No of rows
- nrow(sf_crime)
- map_sf <- get_map('Gurugram', zoom = 12, maptype = 'satellite')
- # PLOT BASIC SF MAP
- ggmap(map_sf)
- # VIRIDIS (inferno), alpha = .5
- ggmap(map_sf) +
- stat_density2d(data = sf_crime, aes(x = lon, y = lat, fill = ..density..), geom = 'tile', contour = F, alpha = .5) +
- scale_fill_viridis(option = 'inferno')
- X Y
- -122.4017618 37.71452361
- -122.4245824 37.76854434
- -122.4450517 37.71294772
- -122.4154488 37.77829352
- -122.4745374 37.78043476
- -122.5047207 37.75952427
- -122.3895176 37.77246824
- -122.3895176 37.77246824
- -122.4217477 37.76274366
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement