thomasp85 / ggraph

Grammar of Graph Graphics
https://ggraph.data-imaginist.com
Other
1.07k stars 116 forks source link

Combine ggraph with ggmap #24

Closed Jim89 closed 6 years ago

Jim89 commented 7 years ago

I'm experiencing difficulty plotting a ggraph on top of a ggmap (metioned it on twitter).

Here's the code I'm running to create the graph and the map:

# Create graph
tot_gr <- tot_adjacency %>% 
    mutate(line = as.factor(line)) %>% 
    graph_from_data_frame(directed = FALSE, vertices = stations)

# Set up the layout using lat and lon
lay <- stations %>% dplyr::rename(y = latitude, x = longitude)

# Create graph layout
lay_data <- createLayout(tot_gr, 'manual', node.positions = lay)

# Set up colours
line_cols <- paste0('#', lines$colour)
names(line_cols) <- lines$name

tube_map <- ggraph(tot_gr, 'manual', data = lay_data) +
    geom_node_point(size = .5) +
    geom_edge_fan(aes(colour = line_name, edge_width = daily_trips), 
                  show.legend = F, edge_alpha = 1) +
    scale_edge_colour_manual(name = "Line", values = line_cols) +
    theme_void() 

map <- get_map(location = c(lon = -0.1275, lat = 51.5072), maptype = "toner-lite")
map_plot <- ggmap(map)

If I then run:

map_plot + tube_map

I get the following error:

Error: Don't know how to add o to a plot

I feel like this could be due to the different names for the aesthetics in the two plots (ggmap uses lat/lon whereas ggraph insists on x and y) but I'm not convinced this is the case.

Appreciate if you can take a look and make some suggestions. If there's any digging I can do on my end to help out, let me know! Thanks.

Here are the data necessary:

# tot_adjacency
tot_adjacency <- structure(list(station1 = c(11L, 11L, 49L, 49L, 82L, 82L, 84L, 
87L, 113L, 113L, 114L, 137L, 137L, 140L, 143L, 143L, 148L, 159L, 
185L, 185L, 192L, 192L, 193L, 246L, 13L, 13L, 16L, 16L, 24L, 
24L, 28L, 28L, 37L, 37L, 48L, 48L, 51L, 51L, 68L, 68L, 72L, 76L, 
76L, 88L, 91L, 98L, 98L, 103L, 105L, 105L, 112L, 112L, 126L, 
127L, 127L, 149L, 149L, 153L, 153L, 154L, 154L, 164L, 177L, 181L, 
186L, 192L, 211L, 215L, 221L, 221L, 226L, 230L, 241L, 2L, 2L, 
11L, 11L, 14L, 14L, 18L, 18L, 25L, 25L, 44L, 44L, 83L, 87L, 87L, 
90L, 90L, 92L, 99L, 99L, 122L, 156L, 166L, 229L, 229L, 248L, 
248L, 3L, 3L, 15L, 15L, 17L, 17L, 18L, 18L, 21L, 21L, 25L, 25L, 
33L, 306L, 33L, 36L, 44L, 44L, 52L, 52L, 66L, 66L, 72L, 73L, 
74L, 74L, 74L, 74L, 74L, 78L, 80L, 80L, 83L, 85L, 87L, 87L, 96L, 
96L, 99L, 108L, 108L, 110L, 122L, 129L, 141L, 164L, 166L, 195L, 
200L, 200L, 209L, 229L, 229L, 231L, 242L, 244L, 248L, 248L, 267L, 
299L, 41L, 41L, 174L, 175L, 216L, 225L, 225L, 228L, 3L, 3L, 11L, 
11L, 14L, 14L, 15L, 33L, 305L, 33L, 36L, 78L, 83L, 90L, 90L, 
92L, 101L, 101L, 147L, 147L, 150L, 156L, 164L, 193L, 200L, 200L, 
218L, 244L, 11L, 11L, 23L, 23L, 28L, 41L, 42L, 43L, 43L, 45L, 
45L, 71L, 71L, 94L, 94L, 107L, 142L, 142L, 144L, 144L, 157L, 
172L, 233L, 247L, 249L, 279L, 2L, 6L, 11L, 11L, 14L, 14L, 46L, 
46L, 53L, 62L, 62L, 75L, 75L, 90L, 90L, 92L, 304L, 94L, 115L, 
115L, 115L, 125L, 125L, 134L, 156L, 168L, 168L, 178L, 179L, 180L, 
184L, 202L, 210L, 220L, 7L, 7L, 8L, 8L, 12L, 12L, 13L, 13L, 22L, 
22L, 29L, 29L, 34L, 34L, 38L, 38L, 40L, 40L, 40L, 40L, 49L, 49L, 
54L, 54L, 55L, 58L, 59L, 59L, 77L, 77L, 84L, 87L, 89L, 89L, 89L, 
93L, 93L, 100L, 102L, 102L, 121L, 136L, 136L, 139L, 151L, 167L, 
169L, 191L, 257L, 261L, 288L, 1L, 1L, 1L, 5L, 5L, 9L, 9L, 10L, 
10L, 17L, 17L, 30L, 30L, 31L, 39L, 39L, 57L, 60L, 60L, 73L, 74L, 
75L, 75L, 99L, 107L, 107L, 110L, 116L, 116L, 116L, 117L, 125L, 
125L, 126L, 130L, 130L, 131L, 133L, 134L, 145L, 146L, 151L, 160L, 
176L, 182L, 187L, 210L, 220L, 235L, 251L, 266L, 26L, 26L, 35L, 
89L, 89L, 95L, 95L, 107L, 107L, 123L, 192L, 198L, 198L, 224L, 
245L, 13L, 4L, 4L, 13L, 19L, 20L, 20L, 27L, 27L, 32L, 32L, 42L, 
42L, 43L, 43L, 61L, 61L, 63L, 63L, 64L, 64L, 65L, 69L, 69L, 86L, 
120L, 135L, 155L, 155L, 201L, 201L, 203L, 204L, 225L, 284L, 95L, 
43L), station2 = c(163L, 212L, 87L, 197L, 163L, 193L, 148L, 279L, 
246L, 298L, 140L, 206L, 298L, 237L, 159L, 206L, 279L, 278L, 237L, 
281L, 197L, 212L, 278L, 281L, 156L, 250L, 91L, 173L, 156L, 164L, 
162L, 192L, 158L, 301L, 126L, 250L, 103L, 215L, 158L, 256L, 286L, 
181L, 296L, 256L, 109L, 173L, 211L, 109L, 177L, 196L, 181L, 196L, 
259L, 186L, 226L, 162L, 208L, 154L, 247L, 230L, 275L, 247L, 239L, 
286L, 208L, 259L, 275L, 301L, 239L, 294L, 296L, 241L, 301L, 156L, 
263L, 83L, 104L, 92L, 167L, 186L, 193L, 161L, 255L, 161L, 166L, 
193L, 255L, 285L, 104L, 145L, 145L, 122L, 236L, 186L, 167L, 263L, 
236L, 273L, 273L, 285L, 263L, 295L, 78L, 269L, 110L, 293L, 186L, 
193L, 67L, 269L, 161L, 255L, 36L, 307L, 164L, 289L, 161L, 166L, 
1L, 265L, 67L, 85L, 73L, 1L, 99L, 122L, 138L, 287L, 293L, 270L, 
205L, 231L, 193L, 129L, 255L, 285L, 195L, 287L, 236L, 141L, 265L, 
209L, 186L, 268L, 213L, 244L, 263L, 205L, 270L, 289L, 242L, 236L, 
273L, 300L, 265L, 295L, 273L, 285L, 268L, 300L, 216L, 253L, 253L, 
253L, 276L, 276L, 295L, 295L, 156L, 295L, 83L, 104L, 92L, 167L, 
78L, 36L, 306L, 164L, 289L, 270L, 193L, 104L, 145L, 145L, 110L, 
227L, 150L, 283L, 227L, 167L, 244L, 218L, 270L, 289L, 283L, 295L, 
28L, 249L, 41L, 157L, 107L, 42L, 183L, 183L, 289L, 207L, 243L, 
172L, 297L, 254L, 290L, 285L, 290L, 297L, 207L, 282L, 233L, 282L, 
279L, 289L, 254L, 285L, 156L, 46L, 104L, 94L, 92L, 167L, 50L, 
53L, 214L, 168L, 280L, 210L, 222L, 104L, 145L, 145L, 305L, 282L, 
178L, 184L, 291L, 134L, 271L, 220L, 167L, 179L, 214L, 202L, 180L, 
199L, 199L, 282L, 291L, 222L, 145L, 188L, 124L, 264L, 56L, 257L, 
157L, 167L, 47L, 111L, 84L, 157L, 100L, 119L, 58L, 81L, 47L, 
89L, 139L, 170L, 87L, 151L, 55L, 56L, 245L, 119L, 240L, 258L, 
93L, 124L, 136L, 279L, 145L, 170L, 277L, 165L, 288L, 111L, 259L, 
277L, 261L, 191L, 279L, 264L, 259L, 188L, 240L, 245L, 258L, 302L, 
302L, 73L, 234L, 265L, 194L, 252L, 31L, 232L, 128L, 95L, 74L, 
110L, 176L, 190L, 303L, 128L, 145L, 187L, 126L, 151L, 182L, 99L, 
210L, 222L, 236L, 133L, 197L, 265L, 117L, 118L, 132L, 118L, 134L, 
271L, 223L, 131L, 132L, 190L, 146L, 220L, 223L, 236L, 197L, 266L, 
234L, 194L, 232L, 235L, 222L, 251L, 252L, 303L, 260L, 274L, 245L, 
145L, 277L, 123L, 224L, 192L, 273L, 145L, 277L, 272L, 273L, 260L, 
272L, 279L, 70L, 201L, 225L, 97L, 65L, 217L, 79L, 201L, 70L, 
204L, 120L, 292L, 79L, 219L, 171L, 238L, 203L, 219L, 106L, 135L, 
97L, 86L, 106L, 152L, 238L, 171L, 225L, 284L, 284L, 292L, 217L, 
247L, 262L, 292L, 160L, 304L), line = c(1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 4L, 
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 6L, 13L, 4L, 4L, 4L, 
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 5L, 5L, 5L, 5L, 5L, 
5L, 5L, 5L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 4L, 13L, 6L, 6L, 6L, 
6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 
7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 
7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 8L, 8L, 8L, 8L, 8L, 8L, 
8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 13L, 8L, 8L, 8L, 8L, 
8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 9L, 9L, 9L, 
9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 
9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 
9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 
10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 
10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 
10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 
10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 11L, 
11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 
11L, 12L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 
13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 
13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 10L, 13L), 
    daily_trips = c(10446, 758, 21846, 16512, 6732, 3583, 158, 
    28143, 8255, 8589, 2435, 11649, 9872, 3955, 19620, 15612, 
    2315, 22780, 4312, 5352, 10200, 2115, 25275, 6992, 121786, 
    38980, 1046, 4352, 119852, 106615, 53609, 35475, 7126, 8832, 
    33089, 27000, 2686, 1049, 4700, 3243, 6820, 25906, 26289, 
    2446, 383, 5535, 13560, 2320, 8046, 11075, 15626, 12646, 
    35912, 45198, 43200, 46175, 44432, 43723, 54595, 21878, 14303, 
    102392, 4123, 9772, 38692, 33275, 15809, 1295, 2600, 1555, 
    32346, 20035, 16329, 16726, 13695, 55923, 39612, 63643, 7200, 
    23220, 23118, 12446, 12378, 7952, 5978, 55923, 20055, 21443, 
    38266, 38592, 68340, 10526, 116718, 21758, 31978, 4506, 23855, 
    31040, 6378, 4060, 1292, 969, 21989, 14555, 71723, 1169, 
    23220, 23118, 11715, 13986, 12446, 12378, 2232, 463, 5620, 
    1749, 7952, 5978, 858, 1440, 8769, 6935, 11169, 22546, 99955, 
    14029, NA, 33503, 3538, 31549, 18272, 13260, 55923, 5020, 
    20055, 21443, 26046, 32343, 116718, 8112, 11158, 5235, 21758, 
    3109, 5923, 7583, 4506, 22058, 37086, 41615, 2040, 23855, 
    31040, 10349, 438, 8715, 6378, 4060, 2443, 9195, 66, 3, NA, 
    NA, 66, 32, 6923, NA, 7929, 969, 55923, 39612, 63643, 7200, 
    21989, 2232, 1475, 5620, 1749, 31549, 55923, 38266, 38592, 
    68340, 4398, 4680, 5738, 6823, 5472, 31978, 7583, 8506, 37086, 
    41615, 7952, 8715, 99966, 5443, 46975, 49898, 124566, 42380, 
    21000, 13258, 18535, 3963, 2452, 4129, 1515, 5283, 16555, 
    183346, 12278, 5646, 6735, 8920, 2538, 6389, 3349, 50498, 
    69, 164952, 16726, 1449, 39612, 65943, 63643, 7200, 432, 
    2632, 3486, 2212, 1660, 11563, 10115, 38266, 38592, 68340, 
    1732, 45212, 28792, 12406, 14783, 8455, 7249, 9032, 31978, 
    7455, 4503, 30975, 9063, 10135, 11286, 32740, 14200, 9506, 
    17083, 71155, 23538, 31386, 39226, 30495, 80203, 54400, 32366, 
    27618, 7003, 15243, 18709, 16686, 8340, 4400, 35595, 79918, 
    38012, 1263, 21846, 14792, 51758, 43015, 56620, 12306, 10409, 
    16446, 12780, 20200, 14546, 28143, 92315, 2386, 109000, 798, 
    7472, 24560, 13803, 6583, 2889, 48929, 52223, 32880, 4252, 
    16515, 7300, 46129, 25798, 4638, 6266, 20086, 27040, 47498, 
    9726, 7949, 12703, 9029, 3120, 6532, 79375, 71723, 21966, 
    20035, 19263, 10589, 10352, 1446, 13772, 10038, 9952, 99955, 
    11563, 10115, 116718, 104895, 30575, 58380, 5018, 3049, 10846, 
    55, 8455, 7249, 24612, 16069, 11532, 19140, 103140, 9032, 
    23720, 96018, 14786, 36655, 25323, 9755, 4312, 7289, 9506, 
    7958, 8023, 28106, 17426, 11838, 20278, 92315, 109000, 86612, 
    30680, 111443, 81980, 93920, 96980, 43238, 51858, 21346, 
    39383, 198560, 952, 849, 8572, 860, 2220, 2409, 1200, 1692, 
    695, 549, 4020, 1080, 1123, 3903, 2912, 3195, 3132, 3266, 
    772, 2140, 1075, 132, 826, NA, 3689, 2700, 3475, 2795, 1952, 
    438, 2798, 986, 480, 458, 43198, 2258), line_name = c("Bakerloo Line", 
    "Bakerloo Line", "Bakerloo Line", "Bakerloo Line", "Bakerloo Line", 
    "Bakerloo Line", "Bakerloo Line", "Bakerloo Line", "Bakerloo Line", 
    "Bakerloo Line", "Bakerloo Line", "Bakerloo Line", "Bakerloo Line", 
    "Bakerloo Line", "Bakerloo Line", "Bakerloo Line", "Bakerloo Line", 
    "Bakerloo Line", "Bakerloo Line", "Bakerloo Line", "Bakerloo Line", 
    "Bakerloo Line", "Bakerloo Line", "Bakerloo Line", "Central Line", 
    "Central Line", "Central Line", "Central Line", "Central Line", 
    "Central Line", "Central Line", "Central Line", "Central Line", 
    "Central Line", "Central Line", "Central Line", "Central Line", 
    "Central Line", "Central Line", "Central Line", "Central Line", 
    "Central Line", "Central Line", "Central Line", "Central Line", 
    "Central Line", "Central Line", "Central Line", "Central Line", 
    "Central Line", "Central Line", "Central Line", "Central Line", 
    "Central Line", "Central Line", "Central Line", "Central Line", 
    "Central Line", "Central Line", "Central Line", "Central Line", 
    "Central Line", "Central Line", "Central Line", "Central Line", 
    "Central Line", "Central Line", "Central Line", "Central Line", 
    "Central Line", "Central Line", "Central Line", "Central Line", 
    "Circle Line", "Circle Line", "Circle Line", "Circle Line", 
    "Circle Line", "Circle Line", "Circle Line", "Circle Line", 
    "Circle Line", "Circle Line", "Circle Line", "Circle Line", 
    "Circle Line", "Circle Line", "Circle Line", "Circle Line", 
    "Circle Line", "Circle Line", "Circle Line", "Circle Line", 
    "Circle Line", "Circle Line", "Circle Line", "Circle Line", 
    "Circle Line", "Circle Line", "Circle Line", "District Line", 
    "District Line", "District Line", "District Line", "District Line", 
    "District Line", "District Line", "District Line", "District Line", 
    "District Line", "District Line", "District Line", "Hammersmith & City Line", 
    "Docklands Light Railway", "District Line", "District Line", 
    "District Line", "District Line", "District Line", "District Line", 
    "District Line", "District Line", "District Line", "District Line", 
    "District Line", "District Line", "District Line", "District Line", 
    "District Line", "District Line", "District Line", "District Line", 
    "District Line", "District Line", "District Line", "District Line", 
    "District Line", "District Line", "District Line", "District Line", 
    "District Line", "District Line", "District Line", "District Line", 
    "District Line", "District Line", "District Line", "District Line", 
    "District Line", "District Line", "District Line", "District Line", 
    "District Line", "District Line", "District Line", "District Line", 
    "District Line", "District Line", "District Line", "District Line", 
    "East London Line", "East London Line", "East London Line", 
    "East London Line", "East London Line", "East London Line", 
    "East London Line", "East London Line", "Hammersmith & City Line", 
    "Hammersmith & City Line", "Hammersmith & City Line", "Hammersmith & City Line", 
    "Hammersmith & City Line", "Hammersmith & City Line", "Hammersmith & City Line", 
    "District Line", "Docklands Light Railway", "Hammersmith & City Line", 
    "Hammersmith & City Line", "Hammersmith & City Line", "Hammersmith & City Line", 
    "Hammersmith & City Line", "Hammersmith & City Line", "Hammersmith & City Line", 
    "Hammersmith & City Line", "Hammersmith & City Line", "Hammersmith & City Line", 
    "Hammersmith & City Line", "Hammersmith & City Line", "Hammersmith & City Line", 
    "Hammersmith & City Line", "Hammersmith & City Line", "Hammersmith & City Line", 
    "Hammersmith & City Line", "Hammersmith & City Line", "Hammersmith & City Line", 
    "Jubilee Line", "Jubilee Line", "Jubilee Line", "Jubilee Line", 
    "Jubilee Line", "Jubilee Line", "Jubilee Line", "Jubilee Line", 
    "Jubilee Line", "Jubilee Line", "Jubilee Line", "Jubilee Line", 
    "Jubilee Line", "Jubilee Line", "Jubilee Line", "Jubilee Line", 
    "Jubilee Line", "Jubilee Line", "Jubilee Line", "Jubilee Line", 
    "Jubilee Line", "Jubilee Line", "Jubilee Line", "Jubilee Line", 
    "Jubilee Line", "Jubilee Line", "Metropolitan Line", "Metropolitan Line", 
    "Metropolitan Line", "Metropolitan Line", "Metropolitan Line", 
    "Metropolitan Line", "Metropolitan Line", "Metropolitan Line", 
    "Metropolitan Line", "Metropolitan Line", "Metropolitan Line", 
    "Metropolitan Line", "Metropolitan Line", "Metropolitan Line", 
    "Metropolitan Line", "Metropolitan Line", "Docklands Light Railway", 
    "Metropolitan Line", "Metropolitan Line", "Metropolitan Line", 
    "Metropolitan Line", "Metropolitan Line", "Metropolitan Line", 
    "Metropolitan Line", "Metropolitan Line", "Metropolitan Line", 
    "Metropolitan Line", "Metropolitan Line", "Metropolitan Line", 
    "Metropolitan Line", "Metropolitan Line", "Metropolitan Line", 
    "Metropolitan Line", "Metropolitan Line", "Northern Line", 
    "Northern Line", "Northern Line", "Northern Line", "Northern Line", 
    "Northern Line", "Northern Line", "Northern Line", "Northern Line", 
    "Northern Line", "Northern Line", "Northern Line", "Northern Line", 
    "Northern Line", "Northern Line", "Northern Line", "Northern Line", 
    "Northern Line", "Northern Line", "Northern Line", "Northern Line", 
    "Northern Line", "Northern Line", "Northern Line", "Northern Line", 
    "Northern Line", "Northern Line", "Northern Line", "Northern Line", 
    "Northern Line", "Northern Line", "Northern Line", "Northern Line", 
    "Northern Line", "Northern Line", "Northern Line", "Northern Line", 
    "Northern Line", "Northern Line", "Northern Line", "Northern Line", 
    "Northern Line", "Northern Line", "Northern Line", "Northern Line", 
    "Northern Line", "Northern Line", "Northern Line", "Northern Line", 
    "Northern Line", "Northern Line", "Piccadilly Line", "Piccadilly Line", 
    "Piccadilly Line", "Piccadilly Line", "Piccadilly Line", 
    "Piccadilly Line", "Piccadilly Line", "Piccadilly Line", 
    "Piccadilly Line", "Piccadilly Line", "Piccadilly Line", 
    "Piccadilly Line", "Piccadilly Line", "Piccadilly Line", 
    "Piccadilly Line", "Piccadilly Line", "Piccadilly Line", 
    "Piccadilly Line", "Piccadilly Line", "Piccadilly Line", 
    "Piccadilly Line", "Piccadilly Line", "Piccadilly Line", 
    "Piccadilly Line", "Piccadilly Line", "Piccadilly Line", 
    "Piccadilly Line", "Piccadilly Line", "Piccadilly Line", 
    "Piccadilly Line", "Piccadilly Line", "Piccadilly Line", 
    "Piccadilly Line", "Piccadilly Line", "Piccadilly Line", 
    "Piccadilly Line", "Piccadilly Line", "Piccadilly Line", 
    "Piccadilly Line", "Piccadilly Line", "Piccadilly Line", 
    "Piccadilly Line", "Piccadilly Line", "Piccadilly Line", 
    "Piccadilly Line", "Piccadilly Line", "Piccadilly Line", 
    "Piccadilly Line", "Piccadilly Line", "Piccadilly Line", 
    "Piccadilly Line", "Victoria Line", "Victoria Line", "Victoria Line", 
    "Victoria Line", "Victoria Line", "Victoria Line", "Victoria Line", 
    "Victoria Line", "Victoria Line", "Victoria Line", "Victoria Line", 
    "Victoria Line", "Victoria Line", "Victoria Line", "Victoria Line", 
    "Waterloo & City Line", "Docklands Light Railway", "Docklands Light Railway", 
    "Docklands Light Railway", "Docklands Light Railway", "Docklands Light Railway", 
    "Docklands Light Railway", "Docklands Light Railway", "Docklands Light Railway", 
    "Docklands Light Railway", "Docklands Light Railway", "Docklands Light Railway", 
    "Docklands Light Railway", "Docklands Light Railway", "Docklands Light Railway", 
    "Docklands Light Railway", "Docklands Light Railway", "Docklands Light Railway", 
    "Docklands Light Railway", "Docklands Light Railway", "Docklands Light Railway", 
    "Docklands Light Railway", "Docklands Light Railway", "Docklands Light Railway", 
    "Docklands Light Railway", "Docklands Light Railway", "Docklands Light Railway", 
    "Docklands Light Railway", "Docklands Light Railway", "Docklands Light Railway", 
    "Docklands Light Railway", "Docklands Light Railway", "Docklands Light Railway", 
    "Docklands Light Railway", "Docklands Light Railway", "Piccadilly Line", 
    "Docklands Light Railway"), colour = c("#ab6612", "#ab6612", 
    "#ab6612", "#ab6612", "#ab6612", "#ab6612", "#ab6612", "#ab6612", 
    "#ab6612", "#ab6612", "#ab6612", "#ab6612", "#ab6612", "#ab6612", 
    "#ab6612", "#ab6612", "#ab6612", "#ab6612", "#ab6612", "#ab6612", 
    "#ab6612", "#ab6612", "#ab6612", "#ab6612", "#df002c", "#df002c", 
    "#df002c", "#df002c", "#df002c", "#df002c", "#df002c", "#df002c", 
    "#df002c", "#df002c", "#df002c", "#df002c", "#df002c", "#df002c", 
    "#df002c", "#df002c", "#df002c", "#df002c", "#df002c", "#df002c", 
    "#df002c", "#df002c", "#df002c", "#df002c", "#df002c", "#df002c", 
    "#df002c", "#df002c", "#df002c", "#df002c", "#df002c", "#df002c", 
    "#df002c", "#df002c", "#df002c", "#df002c", "#df002c", "#df002c", 
    "#df002c", "#df002c", "#df002c", "#df002c", "#df002c", "#df002c", 
    "#df002c", "#df002c", "#df002c", "#df002c", "#df002c", "#f7dc00", 
    "#f7dc00", "#f7dc00", "#f7dc00", "#f7dc00", "#f7dc00", "#f7dc00", 
    "#f7dc00", "#f7dc00", "#f7dc00", "#f7dc00", "#f7dc00", "#f7dc00", 
    "#f7dc00", "#f7dc00", "#f7dc00", "#f7dc00", "#f7dc00", "#f7dc00", 
    "#f7dc00", "#f7dc00", "#f7dc00", "#f7dc00", "#f7dc00", "#f7dc00", 
    "#f7dc00", "#f7dc00", "#0d6928", "#0d6928", "#0d6928", "#0d6928", 
    "#0d6928", "#0d6928", "#0d6928", "#0d6928", "#0d6928", "#0d6928", 
    "#0d6928", "#0d6928", "#f5a6b3", "#00A77E", "#0d6928", "#0d6928", 
    "#0d6928", "#0d6928", "#0d6928", "#0d6928", "#0d6928", "#0d6928", 
    "#0d6928", "#0d6928", "#0d6928", "#0d6928", "#0d6928", "#0d6928", 
    "#0d6928", "#0d6928", "#0d6928", "#0d6928", "#0d6928", "#0d6928", 
    "#0d6928", "#0d6928", "#0d6928", "#0d6928", "#0d6928", "#0d6928", 
    "#0d6928", "#0d6928", "#0d6928", "#0d6928", "#0d6928", "#0d6928", 
    "#0d6928", "#0d6928", "#0d6928", "#0d6928", "#0d6928", "#0d6928", 
    "#0d6928", "#0d6928", "#0d6928", "#0d6928", "#0d6928", "#0d6928", 
    "#0d6928", "#0d6928", "#f3ba22", "#f3ba22", "#f3ba22", "#f3ba22", 
    "#f3ba22", "#f3ba22", "#f3ba22", "#f3ba22", "#f5a6b3", "#f5a6b3", 
    "#f5a6b3", "#f5a6b3", "#f5a6b3", "#f5a6b3", "#f5a6b3", "#0d6928", 
    "#00A77E", "#f5a6b3", "#f5a6b3", "#f5a6b3", "#f5a6b3", "#f5a6b3", 
    "#f5a6b3", "#f5a6b3", "#f5a6b3", "#f5a6b3", "#f5a6b3", "#f5a6b3", 
    "#f5a6b3", "#f5a6b3", "#f5a6b3", "#f5a6b3", "#f5a6b3", "#f5a6b3", 
    "#f5a6b3", "#f5a6b3", "#767b7f", "#767b7f", "#767b7f", "#767b7f", 
    "#767b7f", "#767b7f", "#767b7f", "#767b7f", "#767b7f", "#767b7f", 
    "#767b7f", "#767b7f", "#767b7f", "#767b7f", "#767b7f", "#767b7f", 
    "#767b7f", "#767b7f", "#767b7f", "#767b7f", "#767b7f", "#767b7f", 
    "#767b7f", "#767b7f", "#767b7f", "#767b7f", "#8b004c", "#8b004c", 
    "#8b004c", "#8b004c", "#8b004c", "#8b004c", "#8b004c", "#8b004c", 
    "#8b004c", "#8b004c", "#8b004c", "#8b004c", "#8b004c", "#8b004c", 
    "#8b004c", "#8b004c", "#00A77E", "#8b004c", "#8b004c", "#8b004c", 
    "#8b004c", "#8b004c", "#8b004c", "#8b004c", "#8b004c", "#8b004c", 
    "#8b004c", "#8b004c", "#8b004c", "#8b004c", "#8b004c", "#8b004c", 
    "#8b004c", "#8b004c", "#000000", "#000000", "#000000", "#000000", 
    "#000000", "#000000", "#000000", "#000000", "#000000", "#000000", 
    "#000000", "#000000", "#000000", "#000000", "#000000", "#000000", 
    "#000000", "#000000", "#000000", "#000000", "#000000", "#000000", 
    "#000000", "#000000", "#000000", "#000000", "#000000", "#000000", 
    "#000000", "#000000", "#000000", "#000000", "#000000", "#000000", 
    "#000000", "#000000", "#000000", "#000000", "#000000", "#000000", 
    "#000000", "#000000", "#000000", "#000000", "#000000", "#000000", 
    "#000000", "#000000", "#000000", "#000000", "#000000", "#002d73", 
    "#002d73", "#002d73", "#002d73", "#002d73", "#002d73", "#002d73", 
    "#002d73", "#002d73", "#002d73", "#002d73", "#002d73", "#002d73", 
    "#002d73", "#002d73", "#002d73", "#002d73", "#002d73", "#002d73", 
    "#002d73", "#002d73", "#002d73", "#002d73", "#002d73", "#002d73", 
    "#002d73", "#002d73", "#002d73", "#002d73", "#002d73", "#002d73", 
    "#002d73", "#002d73", "#002d73", "#002d73", "#002d73", "#002d73", 
    "#002d73", "#002d73", "#002d73", "#002d73", "#002d73", "#002d73", 
    "#002d73", "#002d73", "#002d73", "#002d73", "#002d73", "#002d73", 
    "#002d73", "#002d73", "#0076bd", "#0076bd", "#0076bd", "#0076bd", 
    "#0076bd", "#0076bd", "#0076bd", "#0076bd", "#0076bd", "#0076bd", 
    "#0076bd", "#0076bd", "#0076bd", "#0076bd", "#0076bd", "#89cbc1", 
    "#00A77E", "#00A77E", "#00A77E", "#00A77E", "#00A77E", "#00A77E", 
    "#00A77E", "#00A77E", "#00A77E", "#00A77E", "#00A77E", "#00A77E", 
    "#00A77E", "#00A77E", "#00A77E", "#00A77E", "#00A77E", "#00A77E", 
    "#00A77E", "#00A77E", "#00A77E", "#00A77E", "#00A77E", "#00A77E", 
    "#00A77E", "#00A77E", "#00A77E", "#00A77E", "#00A77E", "#00A77E", 
    "#00A77E", "#00A77E", "#00A77E", "#00A77E", "#002d73", "#00A77E"
    )), .Names = c("station1", "station2", "line", "daily_trips", 
"line_name", "colour"), class = c("tbl_df", "tbl", "data.frame"
), row.names = c(NA, -410L))

# stations
stations <- structure(list(id = c(1L, 2L, 3L, 4L, 5L, 7L, 8L, 9L, 10L, 11L, 
12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 24L, 25L, 
26L, 27L, 28L, 29L, 30L, 31L, 32L, 33L, 34L, 36L, 38L, 39L, 40L, 
42L, 44L, 45L, 47L, 48L, 49L, 51L, 52L, 54L, 55L, 56L, 58L, 59L, 
60L, 61L, 63L, 65L, 66L, 67L, 70L, 71L, 72L, 73L, 74L, 75L, 76L, 
77L, 78L, 79L, 80L, 81L, 82L, 83L, 84L, 85L, 87L, 89L, 90L, 91L, 
92L, 93L, 94L, 95L, 96L, 97L, 98L, 99L, 100L, 101L, 102L, 103L, 
104L, 105L, 107L, 108L, 109L, 110L, 111L, 112L, 113L, 114L, 115L, 
116L, 117L, 118L, 119L, 120L, 122L, 123L, 124L, 125L, 126L, 127L, 
128L, 129L, 130L, 131L, 132L, 133L, 134L, 135L, 136L, 137L, 138L, 
139L, 140L, 141L, 142L, 143L, 144L, 145L, 146L, 147L, 148L, 149L, 
150L, 151L, 153L, 154L, 155L, 156L, 157L, 159L, 160L, 161L, 162L, 
163L, 164L, 165L, 166L, 167L, 168L, 169L, 170L, 171L, 172L, 173L, 
176L, 177L, 178L, 179L, 180L, 181L, 182L, 184L, 185L, 186L, 188L, 
190L, 191L, 192L, 193L, 194L, 195L, 196L, 197L, 198L, 199L, 200L, 
201L, 202L, 203L, 205L, 206L, 207L, 208L, 209L, 210L, 211L, 212L, 
213L, 215L, 216L, 217L, 218L, 219L, 220L, 222L, 223L, 224L, 225L, 
226L, 227L, 228L, 229L, 230L, 231L, 234L, 235L, 236L, 237L, 238L, 
239L, 240L, 241L, 242L, 243L, 244L, 245L, 246L, 247L, 248L, 249L, 
250L, 251L, 252L, 253L, 254L, 255L, 257L, 258L, 259L, 260L, 262L, 
263L, 264L, 265L, 266L, 267L, 268L, 269L, 270L, 271L, 272L, 273L, 
274L, 275L, 276L, 277L, 278L, 279L, 281L, 282L, 283L, 284L, 285L, 
286L, 287L, 288L, 289L, 290L, 291L, 292L, 293L, 294L, 295L, 296L, 
297L, 298L, 299L, 300L, 301L, 302L, 303L, 35L, 6L, 23L, 50L, 
46L, 53L, 214L, 62L, 280L, 221L, 121L, 261L, 57L, 187L, 232L, 
88L, 256L, 68L, 158L, 37L, 204L, 233L, 41L, 43L, 183L, 64L, 106L, 
69L, 86L, 152L, 174L, 175L, 304L, 307L, 305L, 306L), latitude = c(51.5028, 
51.5143, 51.5154, 51.5107, 51.5407, 51.5322, 51.5653, 51.6164, 
51.5586, 51.5226, 51.4431, 51.5133, 51.5204, 51.5396, 51.5856, 
51.4905, 51.5121, 51.5148, 51.5087, 51.5403, 51.5504, 51.527, 
51.512, 51.5867, 51.5079, 51.5142, 51.5011, 51.4956, 51.6071, 
51.5273, 51.5269, 51.5766, 51.5248, 51.6028, 51.5481, 51.5392, 
51.5051, 51.5113, 51.6078, 51.5441, 51.5185, 51.508, 51.6177, 
51.4946, 51.4618, 51.4649, 51.4527, 51.5955, 51.418, 51.5129, 
51.4957, 51.5095, 51.5085, 51.5443, 51.5417, 51.5223, 51.552, 
51.5152, 51.5101, 51.492, 51.5765, 51.5168, 51.5874, 51.5394, 
51.5093, 51.4586, 51.6137, 51.5199, 51.5203, 51.4943, 51.5496, 
51.5074, 51.5282, 51.526, 51.596, 51.5203, 51.6012, 51.5472, 
51.5642, 51.4804, 51.5096, 51.5765, 51.4945, 51.5724, 51.5018, 
51.5205, 51.6132, 51.5238, 51.5423, 51.5067, 51.4915, 51.603, 
51.4936, 51.5568, 51.5302, 51.5362, 51.5925, 51.5793, 51.4669, 
51.4713, 51.4598, 51.5829, 51.5033, 51.5009, 51.546, 51.5777, 
51.5538, 51.5174, 51.5075, 51.5526, 51.5539, 51.4713, 51.4733, 
51.4734, 51.5027, 51.5619, 51.4871, 51.4884, 51.5304, 51.4983, 
51.5507, 51.5816, 51.477, 51.5471, 51.5351, 51.5846, 51.5308, 
51.5015, 51.5172, 51.4991, 51.5119, 51.5139, 51.5113, 51.5566, 
51.5683, 51.5123, 51.5178, 51.5052, 51.53, 51.5712, 51.5122, 
51.5136, 51.5225, 51.5249, 51.6082, 51.5108, 51.5186, 51.6294, 
51.4022, 51.5342, 51.4902, 51.5542, 51.5756, 51.4995, 51.5483, 
51.5784, 51.6111, 51.6004, 51.5237, 51.5175, 51.5846, 51.5621, 
51.5094, 51.5263, 51.4813, 51.4819, 51.515, 51.5154, 51.527, 
51.4753, 51.5366, 51.5098, 51.4893, 51.5926, 51.5313, 51.5077, 
51.572, 51.5093, 51.4682, 51.5341, 51.5942, 51.5107, 51.4942, 
51.5753, 51.5763, 51.5234, 51.4633, 51.6171, 51.501, 51.5084, 
51.519, 51.5091, 51.5715, 51.5732, 51.523, 51.5822, 51.5117, 
51.5046, 51.5058, 51.5227, 51.4924, 51.5808, 51.4454, 51.5011, 
51.5646, 51.4941, 51.5701, 51.5007, 51.5569, 51.4154, 51.5917, 
51.495, 51.6194, 51.5221, 51.4723, 51.5439, 51.5416, 51.4994, 
51.5347, 51.5146, 51.5569, 51.5507, 51.4933, 51.5432, 51.5111, 
51.4361, 51.4275, 51.5165, 51.5882, 51.5106, 51.5098, 51.5567, 
51.4951, 51.5904, 51.559, 51.5582, 51.5385, 51.5352, 51.5463, 
51.4861, 51.4965, 51.583, 51.5775, 51.5043, 51.5247, 51.5235, 
51.5036, 51.5519, 51.5635, 51.521, 51.5097, 51.501, 51.518, 51.4872, 
51.6095, 51.5287, 51.5469, 51.5795, 51.507, 51.4907, 51.5696, 
51.5194, 51.512, 51.5492, 51.5326, 51.4214, 51.4343, 51.607, 
51.6179, 51.5975, 51.4627, 51.6736, 51.4979, 51.7052, 51.6679, 
51.6543, 51.6404, 51.647, 51.6573, 51.5606, 51.6503, 51.6302, 
51.6517, 51.6476, 51.6322, 51.6937, 51.6717, 51.6455, 51.6412, 
51.6266, 51.5343, 51.504, 51.4982, 51.5147, 51.5005, 51.4827, 
51.4781, 51.474, 51.4693, 51.4657, 51.4767, 51.4757, 51.5027, 
51.502, 51.5021, 51.5037), longitude = c(-0.2801, -0.0755, -0.0726, 
-0.013, -0.2997, -0.1058, -0.1353, -0.1331, -0.1059, -0.1571, 
-0.1525, -0.0886, -0.0979, 0.081, 0.0887, -0.2139, -0.1879, 0.0613, 
0.055, 0.127, -0.1642, -0.0549, -0.1031, -0.0417, -0.0066, -0.1494, 
-0.0943, -0.325, -0.1243, -0.0208, -0.0247, -0.2136, -0.0119, 
-0.2641, -0.1188, -0.1426, -0.0209, -0.0904, -0.2947, -0.1538, 
-0.1111, -0.1247, 0.0755, -0.2678, -0.1384, -0.1299, -0.148, 
-0.2502, -0.1778, -0.1243, -0.0144, 0.0276, 0.064, 0.1655, 0.1469, 
-0.0173, -0.2387, -0.3017, -0.2882, -0.1973, -0.397, -0.2474, 
-0.165, 0.0518, -0.0021, -0.2112, -0.275, -0.1679, -0.17, -0.1001, 
0.1977, -0.1223, -0.1337, -0.1359, 0.0912, -0.1053, -0.1932, 
-0.1803, -0.1065, -0.195, 0.0716, 0.0663, -0.1829, -0.1941, -0.2267, 
-0.1347, 0.0923, -0.1439, -0.3456, -0.1428, -0.2754, 0.0933, 
-0.2251, -0.178, -0.2933, -0.2575, -0.3351, -0.3366, -0.4227, 
-0.4524, -0.4476, -0.2259, -0.0215, -0.1925, -0.104, -0.1458, 
-0.4499, -0.12, -0.206, -0.1132, 0.2184, -0.3665, -0.3564, -0.3855, 
-0.1527, -0.4421, -0.0101, -0.1053, -0.225, -0.2106, -0.1402, 
-0.3162, -0.285, -0.2047, -0.1939, -0.2786, -0.1238, -0.1607, 
-0.2107, -0.1115, -0.1756, -0.2172, -0.1281, -0.0053, 0.0083, 
-0.0396, -0.0823, -0.0864, -0.1854, -0.0958, -0.094, -0.1586, 
-0.1631, -0.0332, -0.2103, -0.0863, -0.0886, -0.432, -0.1948, 
-0.1387, -0.0145, -0.2503, 0.0899, -0.3142, -0.3687, -0.3184, 
-0.424, -0.4092, -0.2597, -0.2887, -0.3626, -0.3034, -0.1967, 
-0.0873, -0.3522, -0.113, -0.1415, -0.1755, -0.2841, -0.2011, 
-0.3232, -0.1342, -0.1334, -0.3805, 0.0172, -0.0173, -0.2954, 
0.0336, -0.2089, -0.2047, -0.2861, -0.1877, -0.2359, -0.3714, 
0.0454, -0.1466, -0.3013, 0.0439, -0.0525, 0.0465, -0.188, 0.0181, 
-0.4213, -0.4125, -0.1244, -0.0749, -0.056, -0.2187, -0.2265, 
-0.0708, -0.1565, 0.0216, -0.2066, -0.3072, -0.3521, -0.1738, 
-0.3081, -0.0191, -0.3988, -0.1919, 0.0275, -0.2459, -0.3028, 
-0.047, -0.123, -0.2759, -0.0042, -0.1335, -0.174, -0.0973, -0.3366, 
-0.3156, -0.0478, -0.1738, -0.1141, -0.1598, -0.168, -0.131, 
-0.0594, -0.0743, -0.0766, -0.1374, -0.2547, -0.1028, 0.251, 
0.2343, 0.1014, 0.0343, -0.4786, -0.1253, -0.1447, -0.0195, 0.0288, 
-0.0558, -0.1384, -0.1835, -0.1143, -0.2963, -0.2795, -0.2011, 
-0.0265, -0.1254, -0.2809, -0.1953, -0.1883, 0.0056, -0.1906, 
-0.3533, -0.0203, -0.2065, -0.4376, -0.0612, -0.2239, -0.2215, 
-0.2478, -0.2064, -0.1992, 0.0341, -0.1856, -0.1097, -0.1145, 
-0.607, -0.0637, -0.611, -0.561, -0.5183, -0.4733, -0.4412, -0.4177, 
-0.4103, -0.1943, -0.1791, -0.1496, -0.1318, -0.128, 0.1139, 
0.1033, 0.0838, 0.0558, 0.0471, -0.0139, -0.1052, -0.0502, 0.0082, 
0.0039, -0.0096, -0.0149, -0.0216, -0.0174, -0.0142, -0.0327, 
-0.0402, 0.0226, 0.0627, 0.0319, 0.0488), name = c("Acton Town", 
"Aldgate", "Aldgate East", "All Saints", "Alperton", "Angel", 
"Archway", "Arnos Grove", "Arsenal", "Baker Street", "Balham", 
"Bank", "Barbican", "Barking", "Barkingside", "Barons Court", 
"Bayswater", "Beckton", "Beckton Park", "Becontree", "Belsize Park", 
"Bethnal Green", "Blackfriars", "Blackhorse Road", "Blackwall", 
"Bond Street", "Borough", "Boston Manor", "Bounds Green", "Bow Church", 
"Bow Road", "Brent Cross", "Bromley-By-Bow", "Burnt Oak", "Caledonian Road", 
"Camden Town", "Canary Wharf", "Cannon Street", "Canons Park", 
"Chalk Farm", "Chancery Lane", "Charing Cross", "Chigwell", "Chiswick Park", 
"Clapham Common", "Clapham North", "Clapham South", "Colindale", 
"Colliers Wood", "Covent Garden", "Crossharbour & London Arena", 
"Custom House", "Cyprus", "Dagenham East", "Dagenham Heathway", 
"Devons Road", "Dollis Hill", "Ealing Broadway", "Ealing Common", 
"Earl's Court", "Eastcote", "East Acton", "East Finchley", "East Ham", 
"East India", "East Putney", "Edgware", "Edgware Road (B)", "Edgware Road (C)", 
"Elephant & Castle", "Elm Park", "Embankment", "Euston", "Euston Square", 
"Fairlop", "Farringdon", "Finchley Central", "Finchley Road", 
"Finsbury Park", "Fulham Broadway", "Gallions Reach", "Gants Hill", 
"Gloucester Road", "Golders Green", "Goldhawk Road", "Goodge Street", 
"Grange Hill", "Great Portland Street", "Greenford", "Green Park", 
"Gunnersbury", "Hainault", "Hammersmith", "Hampstead", "Hanger Lane", 
"Harlesden", "Harrow & Wealdston", "Harrow-on-the-Hill", "Hatton Cross", 
"Heathrow Terminals 1, 2 & 3", "Heathrow Terminal 4", "Hendon Central", 
"Heron Quays", "High Street Kensington", "Highbury & Islington", 
"Highgate", "Hillingdon", "Holborn", "Holland Park", "Holloway Road", 
"Hornchurch", "Hounslow Central", "Hounslow East", "Hounslow West", 
"Hyde Park Corner", "Ickenham", "Island Gardens", "Kennington", 
"Kensal Green", "Kensington (Olympia)", "Kentish Town", "Kenton", 
"Kew Gardens", "Kilburn", "Kilburn Park", "Kingsbury", "King's Cross St. Pancras", 
"Knightsbridge", "Ladbroke Grove", "Lambeth North", "Lancaster Gate", 
"Latimer Road", "Leicester Square", "Leyton", "Leytonstone", 
"Limehouse", "Liverpool Street", "London Bridge", "Maida Vale", 
"Manor House", "Mansion House", "Marble Arch", "Marylebone", 
"Mile End", "Mill Hill East", "Monument", "Moorgate", "Moor Park", 
"Morden", "Mornington Crescent", "Mudchute", "Neasden", "Newbury Park", 
"Northfields", "Northolt", "Northwick Park", "Northwood", "Northwood Hills", 
"North Acton", "North Ealing", "North Harrow", "North Wembley", 
"Notting Hill Gate", "Old Street", "Osterley", "Oval", "Oxford Circus", 
"Paddington", "Park Royal", "Parsons Green", "Perivale", "Picadilly Circus", 
"Pimlico", "Pinner", "Plaistow", "Poplar", "Preston Road", "Prince Regent", 
"Putney Bridge", "Queen's Park", "Queensbury", "Queensway", "Ravenscourt Park", 
"Rayners Lane", "Redbridge", "Regent's Park", "Richmond", "Roding Valley", 
"Rotherhithe", "Royal Albert", "Royal Oak", "Royal Victoria", 
"Ruislip", "Ruislip Manor", "Russell Square", "Seven Sisters", 
"Shadwell", "Shepherd's Bush (C)", "Shepherd's Bush (H)", "Shoreditch", 
"Sloane Square", "Snaresbrook", "Southfields", "South Ealing", 
"South Harrow", "South Kensington", "South Kenton", "South Quay", 
"South Ruislip", "South Wimbledon", "South Woodford", "Stamford Brook", 
"Stanmore", "Stepney Green", "Stockwell", "Stonebridge Park", 
"Stratford", "St. James's Park", "St. John's Wood", "St. Paul's", 
"Sudbury Hill", "Sudbury Town", "Surrey Quays", "Swiss Cottage", 
"Temple", "Tooting Bec", "Tooting Broadway", "Tottenham Court Road", 
"Tottenham Hale", "Tower Gateway", "Tower Hill", "Tufnell Park", 
"Turnham Green", "Turnpike Lane", "Upminster", "Upminster Bridge", 
"Upney", "Upton Park", "Uxbridge", "Vauxhall", "Victoria", "Walthamstow Central", 
"Wanstead", "Wapping", "Warren Street", "Warwick Avenue", "Waterloo", 
"Wembley Central", "Wembley Park", "Westbourne Park", "Westferry", 
"Westminster", "West Acton", "West Brompton", "West Finchley", 
"West Ham", "West Hampstead", "West Harrow", "West India Quay", 
"West Kensington", "West Ruislip", "Whitechapel", "White City", 
"Willesden Green", "Willesden Junction", "Wimbledon", "Wimbledon Park", 
"Woodford", "Woodside Park", "Wood Green", "Brixton", "Amersham", 
"Bermondsey", "Chesham", "Chalfont & Latimer", "Chorleywood", 
"Rickmansworth", "Croxley", "Watford", "Ruislip Gardens", "High Barnet", 
"Totteridge & Whetstone", "Cockfosters", "Oakwood", "Southgate", 
"Epping", "Theydon Bois", "Debden", "Loughton", "Buckhurst Hill", 
"Pudding Mill Lane", "Southwark", "Canada Water", "Canning Town", 
"North Greenwich", "Cutty Sark", "Greenwich", "Deptford Bridge", 
"Elverson Road", "Lewisham", "New Cross", "New Cross Gate", "West Silvertown", 
"King George V", "Pontoon Dock", "London City Airport"), display_name = c("Acton<br />Town", 
"NULL", "Aldgate<br />East", "All<br />Saints", "NULL", "NULL", 
"NULL", "Arnos<br />Grove", "NULL", "Baker<br />Street", "NULL", 
"NULL", "NULL", "NULL", "NULL", "Barons<br />Court", "NULL", 
"NULL", "Beckton<br />Park", "NULL", "Belsize<br />Park", "Bethnal<br />Green", 
"NULL", "Blackhorse<br />Road", "NULL", "Bond<br />Street", "NULL", 
"Boston<br />Manor", "Bounds<br />Green", "Bow<br />Church", 
"Bow<br />Road", "Brent<br />Cross", "NULL", "Burnt<br />Oak", 
"Caledonian<br />Road", "Camden<br />Town", "Canary<br />Wharf", 
"Cannon<br />Street", "Canons<br />Park", "Chalk<br />Farm", 
"Chancery<br />Lane", "Charing<br />Cross", "NULL", "Chiswick<br />Park", 
"Clapham<br />Common", "Clapham<br />North", "Clapham<br />South", 
"NULL", "Colliers<br />Wood", "Covent<br />Garden", "Crossharbour &<br />London Arena", 
"Custom<br />House", "NULL", "Dagenham<br />East", "Dagenham<br />Heathway", 
"Devons<br />Road", "Dollis<br />Hill", "Ealing<br />Broadway", 
"Ealing<br />Common", "Earl's<br />Court", "NULL", "East<br />Acton", 
"East<br />Finchley", "East<br />Ham", "East<br />India", "East<br />Putney", 
"NULL", "Edgware<br />Road", "Edgware<br />Road", "Elephant &<br />Castle", 
"Elm<br />Park", "NULL", "NULL", "Euston<br />Square", "NULL", 
"NULL", "Finchley<br />Central", "Finchley<br />Road", "Finsbury<br />Park", 
"Fulham<br />Broadway", "Gallions<br />Reach", "Gants<br />Hill", 
"Gloucester<br />Road", "Golders<br />Green", "Goldhawk<br />Road", 
"Goodge<br />Street", "Grange<br />Hill", "Great<br />Portland<br />Street", 
"NULL", "Green<br />Park", "NULL", "NULL", "NULL", "NULL", "Hanger<br />Lane", 
"NULL", "Harrow &<br />Wealdston", "Harrow-<br />on-the-Hill", 
"Hatton<br />Cross", "Heathrow<br />Terminals<br />1, 2 & 3", 
"Heathrow<br />Terminal 4", "Hendon<br />Central", "Heron<br />Quays", 
"High<br />Street<br />Kensington", "Highbury &<br />Islington", 
"NULL", "NULL", "NULL", "Holland<br />Park", "Holloway<br />Road", 
"NULL", "Hounslow<br />Central", "Hounslow<br />East", "Hounslow<br />West", 
"Hyde<br />Park<br />Corner", "NULL", "Island<br />Gardens", 
"NULL", "Kensal<br />Green", "Kensington<br />(Olympia)", "Kentish<br />Town", 
"NULL", "Kew<br />Gardens", "NULL", "Kilburn<br />Park", "NULL", 
"King's Cross<br />St. Pancras", "NULL", "Ladbroke<br />Grove", 
"Lambeth<br />North", "Lancaster<br />Gate", "Latimer<br />Road", 
"Leicester<br />Square", "NULL", "NULL", "NULL", "Liverpool<br />Street", 
"London<br />Bridge", "Maida<br />Vale", "Manor<br />House", 
"Mansion<br />House", "Marble<br />Arch", "NULL", "Mile<br />End", 
"Mill<br />Hill<br />East", "NULL", "NULL", "Moor<br />Park", 
"NULL", "Mornington<br />Crescent", "NULL", "NULL", "Newbury<br />Park", 
"NULL", "NULL", "Northwick<br />Park", "NULL", "Northwood<br />Hills", 
"North<br />Acton", "North<br />Ealing", "North<br />Harrow", 
"North<br />Wembley", "Notting<br />Hill Gate", "Old<br />Street", 
"NULL", "NULL", "Oxford<br />Circus", "NULL", "Park<br />Royal", 
"Parsons<br />Green", "NULL", "Picadilly<br />Circus", "NULL", 
"NULL", "NULL", "NULL", "Preston<br />Road", "Prince<br />Regent", 
"Putney<br />Bridge", "Queens<br />Park", "NULL", "NULL", "Ravenscourt<br />Park", 
"Rayners<br />Lane", "NULL", "Regent's<br />Park", "NULL", "Roding<br />Valley", 
"NULL", "Royal<br />Albert", "Royal<br />Oak", "Royal<br />Victoria", 
"NULL", "Ruislip<br />Manor", "Russell<br />Square", "Seven<br />Sisters", 
"NULL", "Shepherd's<br />Bush", "Shepherd's<br />Bush", "NULL", 
"Sloane<br />Square", "NULL", "NULL", "South<br />Ealing", "South<br />Harrow", 
"South<br />Kensington", "South<br />Kenton", "South<br />Quay", 
"South<br />Ruislip", "South<br />Wimbledon", "South<br />Woodford", 
"Stamford<br />Brook", "NULL", "Stepney<br />Green", "NULL", 
"Stonebridge<br />Park", "NULL", "St. James's<br />Park", "St. John's<br />Wood", 
"St. Paul's", "Sudbury<br />Hill", "Sudbury<br />Town", "Surrey<br />Quays", 
"Swiss<br />Cottage", "NULL", "Tooting<br />Bec", "Tooting<br />Broadway", 
"Tottenham<br />Court<br />Road", "Tottenham<br />Hale", "Tower<br />Gateway", 
"Tower<br />Hill", "Tufnell<br />Park", "Turnham<br />Green", 
"Turnpike<br />Lane", "NULL", "Upminster<br />Bridge", "NULL", 
"Upton<br />Park", "NULL", "NULL", "NULL", "Walthamstow<br />Central", 
"NULL", "NULL", "Warren<br />Street", "Warwick<br />Avenue", 
"NULL", "Wembley<br />Central", "Wembley<br />Park", "Westbourne<br />Park", 
"NULL", "NULL", "West<br />Acton", "West<br />Brompton", "West<br />Finchley", 
"West<br />Ham", "West<br />Hampstead", "West<br />Harrow", "West<br />India<br />Quay", 
"West<br />Kensington", "West<br />Ruislip", "NULL", "White<br />City", 
"Willesden<br />Green", "Willesden<br />Junction", "NULL", "Wimbledon<br />Park", 
"NULL", "Woodside<br />Park", "Wood<br />Green", "NULL", "NULL", 
"NULL", "NULL", "Chalfont &<br />Latimer", "NULL", "NULL", "NULL", 
"NULL", "Ruislip<br />Gardens", "High<br />Barnet", "Totteridge<br />& Whetstone", 
"NULL", "NULL", "NULL", "NULL", "Theydon<br />Bois", "NULL", 
"NULL", "Buckhurst<br />Hill", "Pudding<br />Mill Lane", "NULL", 
"Canada<br />Water", "Canning<br />Town", "North<br />Greenwich", 
"Cutty<br />Sark", "NULL", "Deptford<br />Bridge", "Elverson<br />Road", 
"NULL", "New<br />Cross", "New<br />Cross<br />Gate", "West<br />Silvertown", 
"King<br />George V", "Pontoon<br />Dock", "London<br />City<br />Airport"
), zone = c(3, 1, 1, 2, 4, 1, 2.5, 4, 2, 1, 3, 1, 1, 4, 5, 2, 
1, 3, 3, 5, 2, 2, 1, 3, 2, 1, 1, 4, 3.5, 2, 2, 3, 2.5, 4, 2, 
2, 2, 1, 5, 2, 1, 1, 5, 3, 2, 2, 2.5, 4, 3, 1, 2, 3, 3, 5, 5, 
2, 3, 3, 3, 1.5, 5, 2, 3, 3.5, 2.5, 2.5, 5, 1, 1, 1.5, 6, 1, 
1, 1, 5, 1, 4, 2, 2, 2, 3, 4, 1, 3, 2, 1, 5, 1, 4, 1, 3, 5, 2, 
2.5, 3, 3, 5, 5, 5.5, 6, 6, 3.5, 2, 1, 2, 3, 6, 1, 2, 2, 6, 4, 
4, 5, 1, 6, 2, 2, 2, 2, 2, 4, 3.5, 2, 2, 4, 1, 1, 2, 1, 1, 2, 
1, 3, 3.5, 2, 1, 1, 2, 2.5, 1, 1, 1, 2, 4, 1, 1, 6.5, 4, 2, 2, 
3, 4, 3, 5, 4, 6, 6, 2.5, 3, 5, 4, 1.5, 1, 4, 2, 1, 1, 3, 2, 
4, 1, 1, 5, 3, 2, 4, 3, 2, 2, 4, 1, 2, 5, 4, 1, 4, 5, 2, 3, 2, 
3, 6, 6, 1, 3, 2, 2, 2, 2, 1, 4, 3, 3, 5, 1, 4, 2, 5, 3.5, 4, 
2, 5, 2, 2, 3, 3, 1, 2, 1, 4, 4, 2, 2, 1, 3, 3, 1, 3, 1, 1, 2, 
2.5, 3, 6, 6, 4, 3, 6, 1.5, 1, 3, 4, 2, 1, 2, 1, 4, 4, 2, 2, 
1, 3, 2, 4, 3, 2, 5, 2, 2, 6, 2, 2, 2.5, 3, 3, 3, 4, 4, 3, 2, 
10, 2, 10, 9, 8, 7, 7, 8, 5, 5, 4, 5, 5, 4, 6, 6, 6, 6, 5, 2.5, 
1, 2, 3, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2, 2, 3, 3, 3, 3), total_lines = c(2L, 
2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 5L, 1L, 4L, 3L, 2L, 1L, 2L, 2L, 
1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 2L, 1L, 2L, 
1L, 1L, 1L, 2L, 2L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 2L, 1L, 
1L, 1L, 1L, 3L, 2L, 1L, 4L, 2L, 3L, 1L, 3L, 1L, 2L, 1L, 1L, 1L, 
1L, 3L, 1L, 1L, 1L, 1L, 3L, 1L, 3L, 1L, 1L, 3L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 6L, 1L, 1L, 
1L, 1L, 1L, 2L, 1L, 1L, 1L, 4L, 2L, 1L, 1L, 2L, 1L, 1L, 3L, 1L, 
2L, 4L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 3L, 1L, 1L, 1L, 3L, 4L, 1L, 1L, 1L, 2L, 1L, 1L, 2L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 
2L, 1L, 1L, 2L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 3L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 2L, 2L, 1L, 3L, 2L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 
1L, 1L, 2L, 1L, 1L, 2L, 1L, 2L, 1L, 1L, 1L, 1L, 2L, 2L, 1L, 3L, 
1L, 1L, 1L, 2L, 1L, 4L, 1L, 2L, 1L, 1L, 3L, 1L, 1L, 1L, 3L, 1L, 
1L, 1L, 1L, 1L, 3L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L), rail = c(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 
0L, 1L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 1L, 0L, 0L, 1L, 
0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 
0L, 0L, 0L, 0L, 1L, 1L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 1L, 0L, 0L, 0L, 
0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 1L, 1L, 0L, 0L, 
0L, 0L, 1L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 
0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 
0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 
0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 
0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 
0L, 0L, 0L, 1L, 1L, 1L, 0L, 0L, 0L, 0L, 1L, 1L, 0L, 0L, 0L, 0L, 
0L, 1L, 0L, 1L, 1L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 1L, 1L, 0L, 0L, 
0L, 0L, 1L, 1L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 1L, 0L, 0L, 1L, 
1L, 1L, 0L, 0L, 0L, 0L), name_cln = c("acton town", "aldgate", 
"aldgate east", "all saints", "alperton", "angel", "archway", 
"arnos grove", "arsenal", "baker street", "balham", "bank", "barbican", 
"barking", "barkingside", "barons court", "bayswater", "beckton", 
"beckton park", "becontree", "belsize park", "bethnal green", 
"blackfriars", "blackhorse road", "blackwall", "bond street", 
"borough", "boston manor", "bounds green", "bow church", "bow road", 
"brent cross", "bromley-by-bow", "burnt oak", "caledonian road", 
"camden town", "canary wharf", "cannon street", "canons park", 
"chalk farm", "chancery lane", "charing cross", "chigwell", "chiswick park", 
"clapham common", "clapham north", "clapham south", "colindale", 
"colliers wood", "covent garden", "crossharbour & london arena", 
"custom house", "cyprus", "dagenham east", "dagenham heathway", 
"devons road", "dollis hill", "ealing broadway", "ealing common", 
"earl's court", "eastcote", "east acton", "east finchley", "east ham", 
"east india", "east putney", "edgware", "edgware road (b)", "edgware road (c)", 
"elephant & castle", "elm park", "embankment", "euston", "euston square", 
"fairlop", "farringdon", "finchley central", "finchley road", 
"finsbury park", "fulham broadway", "gallions reach", "gants hill", 
"gloucester road", "golders green", "goldhawk road", "goodge street", 
"grange hill", "great portland street", "greenford", "green park", 
"gunnersbury", "hainault", "hammersmith", "hampstead", "hanger lane", 
"harlesden", "harrow & wealdston", "harrow-on-the-hill", "hatton cross", 
"heathrow terminals 1, 2 & 3", "heathrow terminal 4", "hendon central", 
"heron quays", "high street kensington", "highbury & islington", 
"highgate", "hillingdon", "holborn", "holland park", "holloway road", 
"hornchurch", "hounslow central", "hounslow east", "hounslow west", 
"hyde park corner", "ickenham", "island gardens", "kennington", 
"kensal green", "kensington (olympia)", "kentish town", "kenton", 
"kew gardens", "kilburn", "kilburn park", "kingsbury", "king's cross st. pancras", 
"knightsbridge", "ladbroke grove", "lambeth north", "lancaster gate", 
"latimer road", "leicester square", "leyton", "leytonstone", 
"limehouse", "liverpool street", "london bridge", "maida vale", 
"manor house", "mansion house", "marble arch", "marylebone", 
"mile end", "mill hill east", "monument", "moorgate", "moor park", 
"morden", "mornington crescent", "mudchute", "neasden", "newbury park", 
"northfields", "northolt", "northwick park", "northwood", "northwood hills", 
"north acton", "north ealing", "north harrow", "north wembley", 
"notting hill gate", "old street", "osterley", "oval", "oxford circus", 
"paddington", "park royal", "parsons green", "perivale", "picadilly circus", 
"pimlico", "pinner", "plaistow", "poplar", "preston road", "prince regent", 
"putney bridge", "queen's park", "queensbury", "queensway", "ravenscourt park", 
"rayners lane", "redbridge", "regent's park", "richmond", "roding valley", 
"rotherhithe", "royal albert", "royal oak", "royal victoria", 
"ruislip", "ruislip manor", "russell square", "seven sisters", 
"shadwell", "shepherd's bush (c)", "shepherd's bush (h)", "shoreditch", 
"sloane square", "snaresbrook", "southfields", "south ealing", 
"south harrow", "south kensington", "south kenton", "south quay", 
"south ruislip", "south wimbledon", "south woodford", "stamford brook", 
"stanmore", "stepney green", "stockwell", "stonebridge park", 
"stratford", "st. james's park", "st. john's wood", "st. paul's", 
"sudbury hill", "sudbury town", "surrey quays", "swiss cottage", 
"temple", "tooting bec", "tooting broadway", "tottenham court road", 
"tottenham hale", "tower gateway", "tower hill", "tufnell park", 
"turnham green", "turnpike lane", "upminster", "upminster bridge", 
"upney", "upton park", "uxbridge", "vauxhall", "victoria", "walthamstow central", 
"wanstead", "wapping", "warren street", "warwick avenue", "waterloo", 
"wembley central", "wembley park", "westbourne park", "westferry", 
"westminster", "west acton", "west brompton", "west finchley", 
"west ham", "west hampstead", "west harrow", "west india quay", 
"west kensington", "west ruislip", "whitechapel", "white city", 
"willesden green", "willesden junction", "wimbledon", "wimbledon park", 
"woodford", "woodside park", "wood green", "brixton", "amersham", 
"bermondsey", "chesham", "chalfont & latimer", "chorleywood", 
"rickmansworth", "croxley", "watford", "ruislip gardens", "high barnet", 
"totteridge & whetstone", "cockfosters", "oakwood", "southgate", 
"epping", "theydon bois", "debden", "loughton", "buckhurst hill", 
"pudding mill lane", "southwark", "canada water", "canning town", 
"north greenwich", "cutty sark", "greenwich", "deptford bridge", 
"elverson road", "lewisham", "new cross", "new cross gate", "west silvertown", 
"king george v", "pontoon dock", "london city airport"), zone_cln = c(3, 
1, 1, 2, 4, 1, 3, 4, 2, 1, 3, 1, 1, 4, 5, 2, 1, 3, 3, 5, 2, 2, 
1, 3, 2, 1, 1, 4, 4, 2, 2, 3, 3, 4, 2, 2, 2, 1, 5, 2, 1, 1, 5, 
3, 2, 2, 3, 4, 3, 1, 2, 3, 3, 5, 5, 2, 3, 3, 3, 2, 5, 2, 3, 4, 
3, 3, 5, 1, 1, 2, 6, 1, 1, 1, 5, 1, 4, 2, 2, 2, 3, 4, 1, 3, 2, 
1, 5, 1, 4, 1, 3, 5, 2, 3, 3, 3, 5, 5, 6, 6, 6, 4, 2, 1, 2, 3, 
6, 1, 2, 2, 6, 4, 4, 5, 1, 6, 2, 2, 2, 2, 2, 4, 4, 2, 2, 4, 1, 
1, 2, 1, 1, 2, 1, 3, 4, 2, 1, 1, 2, 3, 1, 1, 1, 2, 4, 1, 1, 7, 
4, 2, 2, 3, 4, 3, 5, 4, 6, 6, 3, 3, 5, 4, 2, 1, 4, 2, 1, 1, 3, 
2, 4, 1, 1, 5, 3, 2, 4, 3, 2, 2, 4, 1, 2, 5, 4, 1, 4, 5, 2, 3, 
2, 3, 6, 6, 1, 3, 2, 2, 2, 2, 1, 4, 3, 3, 5, 1, 4, 2, 5, 4, 4, 
2, 5, 2, 2, 3, 3, 1, 2, 1, 4, 4, 2, 2, 1, 3, 3, 1, 3, 1, 1, 2, 
3, 3, 6, 6, 4, 3, 6, 2, 1, 3, 4, 2, 1, 2, 1, 4, 4, 2, 2, 1, 3, 
2, 4, 3, 2, 5, 2, 2, 6, 2, 2, 3, 3, 3, 3, 4, 4, 3, 2, 10, 2, 
10, 9, 8, 7, 7, 8, 5, 5, 4, 5, 5, 4, 6, 6, 6, 6, 5, 3, 1, 2, 
3, 3, 3, 3, 3, 3, 3, 2, 2, 3, 3, 3, 3)), .Names = c("id", "latitude", 
"longitude", "name", "display_name", "zone", "total_lines", "rail", 
"name_cln", "zone_cln"), class = c("tbl_df", "tbl", "data.frame"
), row.names = c(NA, -306L))

# lines
lines <- structure(list(line = c(1L, 3L, 6L, 7L, 11L, 2L, 4L, 5L, 8L, 
9L, 10L, 12L, 13L), name = c("Bakerloo Line", "Circle Line", 
"Hammersmith & City Line", "Jubilee Line", "Victoria Line", "Central Line", 
"District Line", "East London Line", "Metropolitan Line", "Northern Line", 
"Piccadilly Line", "Waterloo & City Line", "Docklands Light Railway"
), colour = c("ab6612", "f7dc00", "f5a6b3", "767b7f", "0076bd", 
"df002c", "0d6928", "f3ba22", "8b004c", "000000", "002d73", "89cbc1", 
"00A77E"), stripe = c("NULL", "NULL", "NULL", "NULL", "NULL", 
"NULL", "NULL", "NULL", "NULL", "NULL", "NULL", "NULL", "FFFFFF"
)), class = c("tbl_df", "tbl", "data.frame"), row.names = c(NA, 
-13L), .Names = c("line", "name", "colour", "stripe"), spec = structure(list(
    cols = structure(list(line = structure(list(), class = c("collector_integer", 
    "collector")), name = structure(list(), class = c("collector_character", 
    "collector")), colour = structure(list(), class = c("collector_character", 
    "collector")), stripe = structure(list(), class = c("collector_character", 
    "collector"))), .Names = c("line", "name", "colour", "stripe"
    )), default = structure(list(), class = c("collector_guess", 
    "collector"))), .Names = c("cols", "default"), class = "col_spec"))
maikol-solis commented 7 years ago

I have the very same problem. It would be wonderful to be able to combine ggmap and ggraph.

thomasp85 commented 7 years ago

I absolutely want a way to combine ggraph with maps. My current sentiment is that I'll wait for the native sf support that will arrive in the next version of ggplot2 rather than get tangled in with another extension

maikol-solis commented 7 years ago

@thomasp85 Thanks for the update. In a future version of ggraph, Could it be possible download online maps (gmaps or osm) as ggmap does?

thomasp85 commented 7 years ago

This is unlikely to be part of ggraph as this is possibly out of scope. I'll wait with ruling this out completely until I start poking at the problem

jeff-mettel commented 7 years ago

@Jim89 @thomasp85 - Similar to this request (which I would be happy to submit separately), would be enabling network functionality atop Leaflet mapping.

boshek commented 7 years ago

Though I haven't tested it this RPub may be of interest here: https://rpubs.com/debasishb/298685

jeffreyhanson commented 6 years ago

I was looking for a way to plot graphs with sf objects as nodes and couldn't find any solutions online. Since this issue is vaugely related to the plotting of spatial object, I thought I would post a solution here in case any one is interested.

# load packages
library(tidygraph)
library(ggplot2)
library(sf)
library(tibble)

# make data
nodes <- sf::st_read(system.file("shape/nc.shp", package = "sf"), quiet = TRUE)
edges <- tibble(from = 1:5, to = 6:10, type = letters[1:5])

# make centroids
ctr <- as.data.frame(as(st_geometry(st_centroid(nc)), "Spatial")@coords)
names(ctr) <- c("x", "y")

# make graph 
g <- tbl_graph(nodes, edges)

# make plot
p <- ggraph(g, "manual", node.position = ctr) +
     geom_sf(aes(fill = AREA), data = nodes) +
     geom_edge_arc(aes(color = type))

# render plot
print(p)

result