File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# Load libraries
22library(tidyverse )
3+ library(plotly )
34
45# Read sao paulo's travel survey
56rd <- read_csv(" data/scenarios/sao paulo/SP 2012 travel data.csv" )
@@ -59,12 +60,13 @@ mode_df <- data.frame(
5960
6061rd $ mode_string <- as.character(mode_df $ mode_string [match(rd $ mode , mode_df $ mode_int )])
6162
62- ggplot(rd %> %
63+ plotly :: ggplotly( ggplot(rd %> %
6364 filter(! is.na(mode )) %> %
6465 group_by(mode_string ) %> %
6566 summarise(count = n()) %> %
6667 mutate(perc = round(count / sum(count ) * 100 , 1 )),
6768 aes(x = mode_string , y = perc )) +
6869 geom_bar(stat = " identity" ) +
70+ theme_minimal() +
6971 theme(axis.text.x = element_text(angle = 90 , hjust = 1 )) +
70- labs(x = " " , y = " percentage(%)" , title = " Main Mode distribution" )
72+ labs(x = " " , y = " percentage(%)" , title = " Main Mode distribution" ))
You can’t perform that action at this time.
0 commit comments