Introduction:

Bicycling infrastructure plays a critical role in promoting healthy lifestyles, reducing emissions, and making urban environments more livable. For this project, I chose to explore a bike-way data-set to better understand the current and planned state of bicycle paths in Montgomery County. This data-set contains geographic information about bike lanes, shared-use paths, and other cycling designs. I was drawn to this topic because I personally love to bike and enjoy using these lanes, as well as I believe accessible and safe transportation alternatives are essential for sustainable cities. As someone interested in urban planning and environmental impact, analyzing this data lets me dive into how local governments design transportation systems and prioritize various neighborhoods or bikeway types. The data was provided by Montgomery County DTS-GIS & DOT. It includes official geographic and attribute information for bike-ways. Some of the variables I will be using are Name (categorical), Category (categorical), Miles (Quantitative), and Shape_leng (Quantitative). There were several question I wanted to explore for this analysis I want to see which types of bike-ways are more common.

In my project I cleaned the data by removing missing values for miles and standardizing category labels. I used dplyr for grouping and summarizing bike-way lengths, and created several visualizations using ggplot2 and plotly. For the statistical analysis, I ran a linear regression predicting miles using category and shape_leng. The regression had an adjusted R-squared of 1, suggesting that bike-way type and geometric length perfectly explain the segment length; although this result is unusual.

step 4. load libraries and dataset:

library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.4     ✔ readr     2.1.5
## ✔ forcats   1.0.0     ✔ stringr   1.5.1
## ✔ ggplot2   3.5.1     ✔ tibble    3.2.1
## ✔ lubridate 1.9.3     ✔ tidyr     1.3.1
## ✔ purrr     1.0.2     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(ggplot2)
library(plotly)
## 
## Attaching package: 'plotly'
## 
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## 
## The following object is masked from 'package:stats':
## 
##     filter
## 
## The following object is masked from 'package:graphics':
## 
##     layout
library(dplyr)
setwd("~/Library/CloudStorage/OneDrive-montgomerycollege.edu/DATA 110 - Mais Alraee/Project 3")
bikeways <- read.csv("Bikeways_geographic_data.csv")
head(bikeways)
##                                       NAME OBJECTID
## 1                           Dufief Mill Rd      217
## 2 SOUTH GERMANTOWN RECREATIONAL PARK TRAIL      430
## 3 SOUTH GERMANTOWN RECREATIONAL PARK TRAIL      431
## 4 SOUTH GERMANTOWN RECREATIONAL PARK TRAIL      432
## 5 SOUTH GERMANTOWN RECREATIONAL PARK TRAIL      433
## 6 SOUTH GERMANTOWN RECREATIONAL PARK TRAIL      434
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          the_geom
## 1 MULTILINESTRING ((-77.22466892850564 39.10032010643007, -77.22453744379149 39.100653277393874, -77.22440388657299 39.10085392904133, -77.2243107530737 39.10106587304408, -77.22423495957217 39.10128052130765, -77.22415980405113 39.10169775564993, -77.22404064145252 39.10271091753111, -77.22398115120221 39.103238004875294), (-77.2379504635055 39.086904565054716, -77.2373553651095 39.08739827806324, -77.23720420051707 39.08753900520691, -77.23689466218617 39.08782759162376, -77.23683516057113 39.08788248172264, -77.23669770672801 39.08801404451724, -77.23656467300597 39.08814821325229, -77.23643609395978 39.088284948237536, -77.23628622379795 39.088456324998056, -77.23618241292273 39.08858259193307, -77.23605007618116 39.08876892690054, -77.235987374326 39.08886444384335, -77.23598077290767 39.088874499301774, -77.23587190090282 39.0890138134736, -77.23572853463111 39.08923236948852, -77.23539830398606 39.089801462215114, -77.23505961430367 39.09041095391077, -77.23481139607186 39.09085165447176, -77.23468097091649 39.09108511486719, -77.23467028281459 39.09110424591748, -77.23454909961406 39.091315653090575, -77.23438142721135 39.09161249433276, -77.23415575320917 39.092010446590116, -77.23411335878141 39.09208721217458, -77.23384005070882 39.09257575361289, -77.23376338945391 39.09270479168123, -77.23363258488614 39.09291667101881, -77.23349643677402 39.09312715649773, -77.2332670976436 39.09344043153392, -77.23303331356666 39.09374718321669, -77.23303153409928 39.09374951893427, -77.23295778793184 39.09385213189875, -77.23228202382182 39.09475420412969, -77.23216407740219 39.094908067065624, -77.23204153354529 39.09507269095822, -77.2319138335051 39.09523556835836, -77.2317814388116 39.0953960866916, -77.23168898500246 39.09550360916169, -77.23167308120115 39.09552039283148, -77.23157312614376 39.095625882517375, -77.2314530150992 39.095745302307094, -77.23132854819485 39.09586198312457, -77.23119989830418 39.095975765173094, -77.2311165019368 39.09604612833039, -77.2309888393863 39.09615125238664, -77.23085692123166 39.09625353364849, -77.23072111180726 39.09635267592118, -77.23058161871873 39.09644853195203, -77.23049123935894 39.09650762044959, -77.23016041165586 39.09672798456178, -77.23006050000899 39.09679163869658, -77.23003389025132 39.096808591793476, -77.22930093184262 39.09730020539152, -77.22864766824381 39.09773470563234, -77.22849598508965 39.097835593186446), (-77.2424720887747 39.085075343112266, -77.2424913431281 39.085072146832935, -77.24255783904621 39.08506003115103, -77.24282011820561 39.08502921348004, -77.24318357932096 39.08499040944796, -77.24338143803237 39.08497201482777, -77.24348094106817 39.08498033685096, -77.24372509172625 39.08495763775465, -77.24373193893742 39.084957001050775, -77.24421726013009 39.08491363792894, -77.24467655726674 39.08486987945969, -77.2451462452284 39.08482561731206, -77.24517766292756 39.08481629668455, -77.24529864252433 39.08479587617045, -77.24543943693523 39.08477599413036, -77.2455814446104 39.08475670480901, -77.24561680633722 39.08474986291617, -77.24577428729465 39.08472334618498, -77.24587074417259 39.08470509612585, -77.24587362605217 39.08470455139514, -77.24601673553568 39.084677740214495, -77.2461040834975 39.08465620404161, -77.2462141350522 39.084624304064434, -77.24628441006664 39.08460268653896, -77.24635840547745 39.08456901558363, -77.24647883074839 39.084528929542735, -77.2465448172344 39.0845082297966, -77.24661874737632 39.08448346867404, -77.24695277557274 39.084373082892945, -77.2473880042908 39.084231131739124, -77.24785313364436 39.0840830190437, -77.24822798201842 39.083959320305304, -77.24828202107906 39.083942594924835, -77.24835552918545 39.08392044412781, -77.24847352529237 39.083880095438474, -77.24850311387726 39.08386852037793, -77.24858868699164 39.083835045038, -77.24866145070149 39.083802022910696, -77.24874999161274 39.08375627398783, -77.24880643624061 39.0837238620401, -77.24888270026682 39.083675530362186, -77.2489553008247 39.08362404369378, -77.24902412034999 39.08356949597527, -77.24908893869552 39.08351206153676, -77.2491434885527 39.08345784496063, -77.24915984542447 39.083439704883816, -77.24920029374861 39.083394851519024, -77.24920374371233 39.08339053742934, -77.24925252187806 39.08332954281079, -77.24930004408476 39.08326208576513, -77.24934271431928 39.083192687883844, -77.24938040387728 39.083121558433014, -77.24941295435939 39.08304900763162, -77.24943837734322 39.082978524934205, -77.2494625035208 39.082896845279905, -77.24948125702747 39.08281435733002, -77.24949460149655 39.082731232317585, -77.24950250187577 39.08264768651249, -77.24950496901144 39.082562852417105, -77.24952597372939 39.08223975813778, -77.24952636338996 39.08222464539572, -77.24952981843747 39.08217171121155, -77.24953186732877 39.08214031918153, -77.24954303008181 39.08205603856064, -77.24954321182902 39.08205513286393, -77.24955980260172 39.08197232430152, -77.24958214059059 39.08188940349909, -77.24960981653943 39.08180799097382, -77.24962063797358 39.081778002615636, -77.24964976142222 39.081708938839284, -77.24968433067274 39.08164115970461, -77.24972412201757 39.08157514401151, -77.24976213378991 39.081527344585915), (-77.23792657991869 39.08692903887433, -77.23794432038054 39.08691638347291, -77.23815246455253 39.08678467006375, -77.23828938793162 39.086705712656666, -77.23844433051909 39.08662050285878, -77.23860246311462 39.08653881210321, -77.23872098687528 39.08648089391488, -77.23897630919228 39.0863596519993, -77.2393062955347 39.08620400752393, -77.239364451831 39.086176576307224, -77.23948462225529 39.08611889989339, -77.23980060617441 39.085966818297244, -77.24018213259342 39.085786990005204, -77.24045841120476 39.08565932506088, -77.24060329539522 39.085598346649, -77.24080289529807 39.08551862514444, -77.2410052919527 39.08544268452513, -77.24113179777532 39.08539983772848, -77.24132066571875 39.08533984432959, -77.24151165641291 39.085283882753075, -77.24248195277349 39.085066587589836))
## 2                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           MULTILINESTRING ((-77.30284746851838 39.15172190719219, -77.30285248969177 39.151680409162395, -77.30280178373225 39.15167446969615))
## 3                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                MULTILINESTRING ((-77.30285248538544 39.151679398485285, -77.30289395239753 39.151651971252655))
## 4                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             MULTILINESTRING ((-77.31031956708611 39.150909950336704, -77.31036623128179 39.15089477007465, -77.31042096178828 39.15088207894459, -77.31046928016967 39.150876932688774, -77.31049990684292 39.15087936028771, -77.31060152073796 39.15090167579118, -77.31072087573924 39.15092770679799, -77.31080796514308 39.150945041401826, -77.3109014458644 39.15094981276015, -77.31102874779208 39.150950729914726, -77.31112216811964 39.15094169841973, -77.31121713953807 39.150918862597486, -77.31128552227952 39.15089609729617, -77.3113675584844 39.150863258167995, -77.31144150945272 39.150824167343394, -77.31149132494782 39.150792668518285, -77.31155071929832 39.15074107006402, -77.31162618255618 39.15067939044055, -77.31169361786249 39.15062400702887, -77.31174015386105 39.15057996967965, -77.31178020516919 39.1505271677328, -77.31181778032 39.15046057131901, -77.31184815365465 39.15040528547929, -77.31187840698591 39.15032239697205, -77.31189740046702 39.150244558526, -77.31190512774252 39.15016925785416, -77.31190652338913 39.15012032220107, -77.31190557622125 39.150087703427175, -77.31190229697542 39.15007516591545, -77.31189250240558 39.15004633508939, -77.31186007301676 39.14999999902247, -77.31179194615221 39.14989729802227, -77.31174974877194 39.149828404134325, -77.31173354126624 39.14980711826786, -77.31168668117222 39.1497771311685, -77.31163499758536 39.149749665578526, -77.31158011417713 39.14972722768506, -77.31151561123208 39.149716106759186, -77.31141404822175 39.1497050851443, -77.311360052529 39.149701464144975, -77.31132459845473 39.1497003034934, -77.31128111980169 39.14970669205954, -77.31122318815756 39.14972441221159, -77.311168475161 39.14974086718684, -77.31112669035699 39.14976607145529, -77.31100765006678 39.14981155573276, -77.31089664956302 39.149853253256694, -77.31078561601494 39.14988742284065, -77.31068906174511 39.149916536535954, -77.31049666728384 39.14995343103325, -77.31031474142412 39.14998904360287, -77.3102358685359 39.15000807169284, -77.31017469807827 39.15002203458269, -77.30997811502077 39.15002255450591, -77.30990399997731 39.15002400524358, -77.30981617667804 39.15002298255313, -77.30967274055433 39.150017088389674, -77.30958891385329 39.15000852795216, -77.30947768824305 39.14999878407834, -77.30925997886291 39.14995795454648, -77.30911321076131 39.14992697511738, -77.30890598582046 39.14988862689226, -77.30868827710617 39.14984779629764, -77.30845123825775 39.14980827096082, -77.3083367683287 39.149793517127854, -77.30815702343547 39.14977516946092, -77.30807318632155 39.1497640974596, -77.30801355104836 39.14976049063937, -77.30793783443855 39.14976445304901, -77.30789275052678 39.149772100278334, -77.30782194334328 39.149793615169266, -77.30770933607512 39.14983656869315, -77.30757420779764 39.14988836391769, -77.30745596478096 39.149932587685804, -77.30734809165864 39.149952945583955, -77.30724662772734 39.14996450296156, -77.30715160751258 39.149976043369776, -77.30704049610462 39.14999264595831, -77.30688589030811 39.15001187010524, -77.30679089704685 39.1500296832669, -77.30660979055386 39.15006905234773, -77.30634419053135 39.15013247961963, -77.30622992706928 39.1501653985159, -77.30610601059095 39.150202107815126, -77.30602607779879 39.15021307374625))
## 5                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            MULTILINESTRING ((-77.30674788571979 39.15110715392231, -77.30662018001244 39.1511419477734, -77.30653664947693 39.151157482364376))
## 6                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    MULTILINESTRING ((-77.30728877576466 39.14996089201943, -77.30721369004 39.149654775293456))
##   OBJECTID_1             Category Level       Miles  feet      Drawn
## 1          2           Bike Lanes    NA 1.928977000 10185 orthophoto
## 2        133 Paved Off-Road Trail    NA 0.005681818    30           
## 3        134 Paved Off-Road Trail    NA 0.002840909    15           
## 4        135 Paved Off-Road Trail    NA 0.463447000  2447           
## 5        136 Paved Off-Road Trail    NA 0.011931820    63           
## 6        137 Paved Off-Road Trail    NA 0.021590910   114           
##        Jurisdicti         First_Map Checked_20  Shape_Leng Notes orig_ogc_f
## 1 MC DOT or other before April 2011        Yes 10185.00223                1
## 2                                      Not yet    29.72270              132
## 3                                      Not yet    15.42975              133
## 4                                      Not yet  2446.74686              134
## 5                                      Not yet    62.72401              135
## 6                                      Not yet   113.50861              136

Step 5. cleaning, wrangling, + exploring the data variables

# Making the names lower case
names(bikeways) <- tolower(names(bikeways))

# Cleaning
bikeways_clean <- bikeways |>
  filter(!is.na(miles)) |>
  mutate(type = as.factor(category))

# Checking levels
table(bikeways_clean$type)
## 
##                                Bike Lanes      Natural Surface 
##                    3                   66                   51 
## Paved Off-Road Trail Separated Bike Lanes             Sharrows 
##                  821                    5                   45 
##            Shoulders Signed on-road route 
##                   41                  183
# Count of each category
category_counts <- bikeways_clean |>
  count(category, sort = TRUE)

# Total miles by category
category_miles <- bikeways_clean |>
  group_by(category) |>
  summarize(total_miles = sum(miles, na.rm = TRUE)) |>
  arrange(desc(total_miles))

# Combining both
category_summary <- left_join(category_counts, category_miles, by = "category")
print(category_summary)
##               category   n total_miles
## 1 Paved Off-Road Trail 821  284.484848
## 2 Signed on-road route 183   50.591478
## 3           Bike Lanes  66   55.414773
## 4      Natural Surface  51   48.330112
## 5             Sharrows  45   19.780681
## 6            Shoulders  41   41.624052
## 7 Separated Bike Lanes   5    1.680682
## 8                        3    0.256250

Step 6.

Visualizations:

# Plot number of bike-ways per type
ggplot(category_summary, aes(x = reorder(category, n), y = n)) +
  geom_col(fill = "skyblue") +
  coord_flip() +
  labs(title = "Number of Bikeway Segments by Type",
       x = "Bikeway Type", y = "Number of Segments") +
  theme_minimal()

# Plot total miles per type
ggplot(category_summary, aes(x = reorder(category, total_miles), y = total_miles)) +
  geom_col(fill = "seagreen") +
  coord_flip() +
  labs(title = "Total Bikeway Miles by Type",
       x = "Bikeway Type", y = "Total Miles") +
  theme_minimal()

Step 7. Linear Regression Model:

## Linear Regression Model
model <- lm(miles ~ category + shape_leng, data = bikeways_clean)
summary(model)
## 
## Call:
## lm(formula = miles ~ category + shape_leng, data = bikeways_clean)
## 
## Residuals:
##        Min         1Q     Median         3Q        Max 
## -1.003e-04 -4.680e-05 -1.680e-06  4.691e-05  1.079e-04 
## 
## Coefficients:
##                                Estimate Std. Error    t value Pr(>|t|)    
## (Intercept)                  -1.777e-05  3.150e-05     -0.564    0.573    
## categoryBike Lanes            1.743e-05  3.225e-05      0.540    0.589    
## categoryNatural Surface       1.721e-05  3.247e-05      0.530    0.596    
## categoryPaved Off-Road Trail  1.885e-05  3.157e-05      0.597    0.551    
## categorySeparated Bike Lanes -3.218e-05  3.985e-05     -0.807    0.420    
## categorySharrows              1.194e-06  3.255e-05      0.037    0.971    
## categoryShoulders             2.957e-05  3.270e-05      0.904    0.366    
## categorySigned on-road route  2.248e-05  3.176e-05      0.708    0.479    
## shape_leng                    1.894e-04  4.242e-10 446473.285   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 5.456e-05 on 1206 degrees of freedom
## Multiple R-squared:      1,  Adjusted R-squared:      1 
## F-statistic: 2.697e+10 on 8 and 1206 DF,  p-value: < 2.2e-16
# Diagnostic plots to check assumptions
par(mfrow = c(2, 2))
plot(model)

par(mfrow = c(1, 1))

I created a linear regression model to predict the length of bike-way segments (miles) using two predictors: category (type of bike-way) and shape_leng (the shape length in map units). The p-value for shape_leng was significant, indicating that geometric length has a strong significant effect on reported miles. One or two category types were somewhat significant, suggesting the possibility of a bike-way type to also influence the segment length. The adjusted R^2 of the model was 1, suggesting that 100% of the variation in segment length is explained by bike-way type and geometry.

Step 8.

Visualization 1:

# This box plot shows the distribution of bike-way Miles by category. It helps us compare how long segments tend to be across different bike-way types,
# Highlighting differences in minimum, median, and maximum values, as well as variability and outliers.

# Boxplot: Bike-way Miles by Category
ggplot(bikeways_clean, aes(x = category, y = miles, fill = category)) +
  geom_boxplot(color = "black") +
  coord_flip() +
  labs(title = "Distribution of Bikeway Segment Lengths by Type",
       x = "Bikeway Type",
       y = "Segment Length (Miles)") +
  scale_fill_manual(values = c(
    "Signed on-road route" = "#1f77b4",
    "Shoulders" = "#ff7f0e",
    "Sharrows" = "#2ca02c",
    "Separated Bike Lanes" = "#d62728",
    "Paved Off-Road Trail" = "#9467bd",
    "Natural Surface" = "#0ea7b5", 
    "Bike Lanes" = "#4d7358"  )) +
  theme_minimal() +
  theme(legend.position = "none")

This box plot allows us to compare how bikeway segment lengths vary by type. For each bikeway category, we see the median length, the interquartile range (middle 50% of values), and any outliers. For example, trail segments like natural surface, may tend to be longer and more variable, while bike lanes and shared roadways may cluster around shorter lengths. Outliers highlight especially long or short segments. This helps identify which types of bikeways tend to be longer, more consistent, or more dispersed.

Visualization 2:

# This pie chart shows the proportion of bikeway segments by type. It helps us understand the distribution of infrastructure types across all entries in the dataset.

# Count bikeway types
bikeway_counts <- bikeways_clean %>%
  count(category)

# Create interactive pie chart
plot_ly(bikeway_counts, labels = ~category, values = ~n, type = 'pie',
        textinfo = 'label+percent',
        insidetextorientation = 'radial',
        marker = list(colors = c(
          "Signed on-road route" = "#1f77b4",
          "Shoulders" = "#ff7f0e",
          "Sharrows" = "#2ca02c",
          "Separated Bike Lanes" = "#d62728",
          "Paved Off-Road Trail" = "#9467bd",
          "Natural Surface" = "#0ea7b5", 
          "Bike Lanes" = "#4d7358"
        ))) %>%
  layout(title = "Interactive Pie Chart: Proportion of Bikeway Types")

The pie chart above shows the percentage of bike-way segments that fall under each category. This visualization focuses on segment count, not length, so it highlights how common each type of bike-way is across the data-set. A large proportion for one category might suggest it’s widely used, even if its total mileage is smaller — for example, short shared roadway segments might appear frequently since people may use it for riding to work or class. This helps us understand the density of different infrastructure types rather than just their extent.

Step 9 part b.

The visualizations showed clear patterns in how bike-ways are used. Shared roadways made up the largest number of segments, while trails accounted for the most total mileage. The boxplot revealed that trail segments tend to be longer and more varied, while other types like bike lanes are shorter and more consistent. One surprise was how strong the relationship was between shape_leng and miles, which may be due to them being derived from the same underlying geometry. I had hoped to map the data spatially, but it wasn’t in a GIS format and I didn’t have coordinates. In the future, I would use spatial data to visualize equity and neighborhood coverage. Overall, the project answered my research question and gave me new insights into bikeway infrastructure and how data visualization helps communicate public planning trends.