Bus routes in the Helsinki metropolitan area: Difference between revisions

From Opasnet
Jump to navigation Jump to search
mNo edit summary
 
Line 14: Line 14:
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.
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")
  <nowiki>bus.routes <- read.table("M:/Composite traffic/Bus_routes.txt", fill = TRUE, sep = "\t")

Latest revision as of 10:08, 19 August 2011

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>