This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.
When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
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
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.
한 달간 유럽으로 여행을 갈 예정입니다. 여행 때 방문할 도시와 기간,
경로 등을 데이터로 만들고
원의 크기와 선을 사용하여 지도 위에 표현해 보았습니다.
데이터셋을 직접 만들었습니다.
방문도시는 베를린, 암스테르담, 브뤼셀, 파리, 취리히 순으로 설정했습니다.
각 위도와 경도 정보는 구글 지도를 참고했습니다.
각 도시별 머무는 체류일은 다음과 같습니다.
체류일에 따라 원의 면적을 설정했습니다.
radius = ~days * 3000library(leaflet)
library(dplyr)
# 데이터 생성
travel <- data.frame(
city = c("Berlin", "Amsterdam", "Brussels", "Paris", "Zurich"),
lat = c(52.52, 52.37, 50.85, 48.85, 47.37),
lon = c(13.405, 4.895, 4.35, 2.35, 8.55),
days = c(1, 3, 2, 15, 10)
)
# 팝업 텍스트 추가
travel <- travel %>%
mutate(popup = paste0(city, "<br>체류일: ", days, "일"))
# 지도 시각화
leaflet(travel) %>%
addProviderTiles(providers$CartoDB.DarkMatter) %>%
setView(lng = 7.9477, lat = 50.0917, zoom = 5) %>%
addCircles(
lng = ~lon, lat = ~lat,
radius = ~days * 3000,
popup = ~popup,
color = "yellow"
) %>%
addMiniMap(width = 150, height = 150) %>%
addPolylines(lng = ~lon, lat = ~lat, weight = 0.5, color = "yellow")
지도 시각화를 통해 여행 경로를 직관적으로 이해할 수 있었고,
체류일을 반영한 원의 크기 조절과 경로 시각화를 통해 정보를 효과적으로
전달할 수 있었습니다.
이상 보고를 마칩니다. 감사합니다.