Bus routes in the Helsinki metropolitan area: Difference between revisions
Jump to navigation
Jump to search
(Created page with "{{variable|moderator=|stub=Yes}} Category:Composite traffic == Question == What are the routes of bus-lines running in the Helsinki metropolitan area? == Answer == {{resu...") |
m (→Rationale) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 13: | Line 13: | ||
See [[Composite traffic]] and [[File:Composite traffic.ANA]]. | See [[Composite traffic]] and [[File:Composite traffic.ANA]]. | ||
Data was exported from the "All_bus_routes" node in Analytica and transformed using the following R code. | |||
<nowiki>bus.routes <- read.table("M:/Composite traffic/Bus_routes.txt", fill = TRUE, sep = "\t") | |||
temp <- strsplit(as.character(bus.routes[4:nrow(bus.routes),2]), ",") | |||
bus.routes <- data.frame(bus.routes[rep(4:nrow(bus.routes), sapply(temp, length)), c(1,3)], unlist(temp)) | |||
colnames(bus.routes) <- c("Route_id", "Time_id", "Result") | |||
bus.routes$Route_order <- 1 | |||
while(nrow(bus.routes[duplicated(bus.routes[,c("Route_id", "Time_id", "Route_order")]),]) > 0) { | |||
bus.routes$Route_order <- ifelse(duplicated(bus.routes[,c("Route_id", "Time_id", "Route_order")]), bus.routes$Route_order + 1, | |||
bus.routes$Route_order) | |||
}</nowiki> | |||
==See also== | ==See also== | ||
*[[Composite traffic]] | |||
*[[File:Composite traffic.ANA]] | |||
==Keywords== | ==Keywords== |
Latest revision as of 10:08, 19 August 2011
Moderator:Nobody (see all) Click here to sign up. |
This page is a stub. You may improve it into a full page. |
Upload data
|
Question
What are the routes of bus-lines running in the Helsinki metropolitan area?
Answer
{{#opasnet_base_link:Op_en5336}}
Rationale
See Composite traffic and File:Composite traffic.ANA.
Data was exported from the "All_bus_routes" node in Analytica and transformed using the following R code.
bus.routes <- read.table("M:/Composite traffic/Bus_routes.txt", fill = TRUE, sep = "\t") temp <- strsplit(as.character(bus.routes[4:nrow(bus.routes),2]), ",") bus.routes <- data.frame(bus.routes[rep(4:nrow(bus.routes), sapply(temp, length)), c(1,3)], unlist(temp)) colnames(bus.routes) <- c("Route_id", "Time_id", "Result") bus.routes$Route_order <- 1 while(nrow(bus.routes[duplicated(bus.routes[,c("Route_id", "Time_id", "Route_order")]),]) > 0) { bus.routes$Route_order <- ifelse(duplicated(bus.routes[,c("Route_id", "Time_id", "Route_order")]), bus.routes$Route_order + 1, bus.routes$Route_order) }
See also
Keywords
References
Related files
<mfanonymousfilelist></mfanonymousfilelist>