knitr::opts_chunk$set(collapse = T, comment = "#>") options(tibble.print_min = 4L, tibble.print_max = 4L) library(seoulsubway)
This document introduces you to seoulsubway's basic set of tools, and shows you how to apply them to sample data("subway_sample").
data("subway_sample") dim(subway_sample) head(subway_sample)
Note that subway_sample
is a data.table and data.frame. It contains 5000 obs(path sample) and 7 variables.
Seven variables include riding station, riding line, getting off station, getting off line, time, and number of passengers.
shortestpath()
will give you information about the shortest path to the subway.
shortestpath_0()
will give you information about the shortest path to the subway when you don't transfer.
shortestpath_1()
will give you information about the shortest path to the subway when you do transfer only one time.
shortestpath_2()
will give you information about the shortest path to the subway when you do transfer only two time.
shortestpath_3()
will give you information about the shortest path to the subway when you do transfer only three time.
path_plot()
will give you map which include shortestpath informataion.
when you input arrival_line == depart_line path route.
shortestpath_0
will give you information about the shortest path to the subway when you don't transfer. also It considered circulate line #2
samplepath <- subway_sample[which(subway_sample$ID=="ID124"),] samplepath shortestpath_0(depart = samplepath$up_Name, depart_line = samplepath$up_Line, arrival = samplepath$down_Name, arrival_line = samplepath$down_Line)
shortestpath_1
will give you information about the shortest path to the subway when you do only one transfer.
samplepath <- subway_sample[which(subway_sample$ID=="ID142"),] samplepath shortestpath_1(depart = samplepath$up_Name, depart_line = samplepath$up_Line, arrival = samplepath$down_Name, arrival_line = samplepath$down_Line)
shortestpath_2
will give you information about the shortest path to the subway when you do two transfer.
samplepath <- subway_sample[which(subway_sample$ID=="ID10"),] samplepath shortestpath_2(depart = samplepath$up_Name, depart_line = samplepath$up_Line, arrival = samplepath$down_Name, arrival_line = samplepath$down_Line)
shortestpath_3
will give you information about the shortest path to the subway when you do three transfer.
samplepath <- subway_sample[which(subway_sample$ID=="ID10"),] samplepath shortestpath_3(depart = samplepath$up_Name, depart_line = samplepath$up_Line, arrival = samplepath$down_Name, arrival_line = samplepath$down_Line)
shortestpath
will give you information about the shortest path to the subway in all case.
we can compare these result with shortestpath_2 above.
when we input same path in shortestpath_2()
and shortestpath()
, but shortestpath()
in all case get another path.
because shortestpath()
will give you totally selected path from another three.
shortestpath(depart = samplepath$up_Name, depart_line = samplepath$up_Line, arrival = samplepath$down_Name, arrival_line = samplepath$down_Line)
path_plot
will give you a map which includes shortestpath information.
It depends on 'nkmap' packages. i suggest to install nkmap in "subinjo92" 's github.
library(nkmap) samplepath <- subway_sample[which(subway_sample$ID=="ID15"),] samplepath path_plot(depart = samplepath$up_Name, depart_line = samplepath$up_Line, arrival = samplepath$down_Name, arrival_line = samplepath$down_Line, naver_secret, naver_key, kakao_key, zoom =8) samplepath <- subway_sample[which(subway_sample$ID=="ID30"),] samplepath path_plot(depart = samplepath$up_Name, depart_line = samplepath$up_Line, arrival = samplepath$down_Name, arrival_line = samplepath$down_Line, naver_secret, naver_key, kakao_key, zoom =7)
checkline()
in get_trasferinfo()
will give you accurate transfer path.
get_pathinfo()
will give you total time & count from A->B in same line.
get_transfercriteria()
will give you selected case of transfer route through longitude&lattitude. This function will divide the wide space based depart/arrival station.
get_transferinfo()
will give you all case of transfer route.
get_path()
will give you binary path information.
get_total_count()
will give you total use of subway count for each station in data.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.