서울시 지도 R 프로그램

Choi youung won.

library(readxl)
library(ggmap)
## 필요한 패키지를 로딩중입니다: ggplot2
## ℹ Google's Terms of Service: <https://mapsplatform.google.com>
##   Stadia Maps' Terms of Service: <https://stadiamaps.com/terms-of-service/>
##   OpenStreetMap's Tile Usage Policy: <https://operations.osmfoundation.org/policies/tiles/>
## ℹ Please cite ggmap if you use it! Use `citation("ggmap")` for details.
library(dplyr)
## 
## 다음의 패키지를 부착합니다: 'dplyr'
## 
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## 
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(ggplot2)
data <-read_excel("C:/rsample/장애인복지관.xlsx")
register_google(key="AIzaSyBDSAqpeWrydo385GZdMsloBsYkfj5GaJE")
strK="소노휴양평"
location=geocode(strK)
## ℹ <https://maps.googleapis.com/maps/api/geocode/json?address=%EC%86%8C%EB%85%B8%ED%9C%B4%EC%96%91%ED%8F%89&key=xxx>
markers_data<-data.frame(lon=location$lon,lat=location$lat)
gg_map <-get_googlemap(strK,maptype = "roadmap",
                       zoom = 13,markers = markers_data)
## ℹ <https://maps.googleapis.com/maps/api/staticmap?center=%EC%86%8C%EB%85%B8%ED%9C%B4%EC%96%91%ED%8F%89&zoom=13&size=640x640&scale=2&maptype=roadmap&markers=37.469024,127.532572&key=xxx>
## ℹ <https://maps.googleapis.com/maps/api/geocode/json?address=%EC%86%8C%EB%85%B8%ED%9C%B4%EC%96%91%ED%8F%89&key=xxx>
ggmap(gg_map)

summary(cars)
##      speed           dist       
##  Min.   : 4.0   Min.   :  2.00  
##  1st Qu.:12.0   1st Qu.: 26.00  
##  Median :15.0   Median : 36.00  
##  Mean   :15.4   Mean   : 42.98  
##  3rd Qu.:19.0   3rd Qu.: 56.00  
##  Max.   :25.0   Max.   :120.00
location=geocode(strK)
## ℹ <https://maps.googleapis.com/maps/api/geocode/json?address=%EC%86%8C%EB%85%B8%ED%9C%B4%EC%96%91%ED%8F%89&key=xxx>
location
## # A tibble: 1 × 2
##     lon   lat
##   <dbl> <dbl>
## 1  128.  37.5

Including Plots

You can also embed plots, for example:

Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.