corrected hour format
This commit is contained in:
parent
10a467d608
commit
e9dfdbd67b
@ -147,7 +147,6 @@ server <- function(input, output, session) {
|
|||||||
crashes_per_hours <- airplane_crashes %>% count(Hour)
|
crashes_per_hours <- airplane_crashes %>% count(Hour)
|
||||||
crashes_per_hours <- crashes_per_hours[-c(1,26,27,28), ]
|
crashes_per_hours <- crashes_per_hours[-c(1,26,27,28), ]
|
||||||
|
|
||||||
|
|
||||||
#dodanie pozycji labeli
|
#dodanie pozycji labeli
|
||||||
# crashes_per_hours <- crashes_per_hours %>%
|
# crashes_per_hours <- crashes_per_hours %>%
|
||||||
# arrange(Hour) %>%
|
# arrange(Hour) %>%
|
||||||
@ -161,8 +160,12 @@ server <- function(input, output, session) {
|
|||||||
# theme(legend.position="none")
|
# theme(legend.position="none")
|
||||||
|
|
||||||
df <- crashes_per_hours
|
df <- crashes_per_hours
|
||||||
#df <- paste(df$Hour, ":00")
|
|
||||||
|
crashes_per_months$Month[crashes_per_months$Month == 1] <- "January"
|
||||||
|
|
||||||
df <- df %>% arrange(Hour)
|
df <- df %>% arrange(Hour)
|
||||||
|
df$Hour <- as.character(df$Hour)
|
||||||
|
df$Hour <- paste(df$Hour, ":00", sep = "")
|
||||||
fig <- df %>% plot_ly(labels = ~Hour, values = ~n, sort=FALSE)
|
fig <- df %>% plot_ly(labels = ~Hour, values = ~n, sort=FALSE)
|
||||||
fig <- fig %>% add_pie(hole = 0.4)
|
fig <- fig %>% add_pie(hole = 0.4)
|
||||||
fig <- fig %>% layout(title = "No. of crashes per hour", xaxis = list(showgrid = FALSE, zeroline = FALSE, showticklabels = FALSE),
|
fig <- fig %>% layout(title = "No. of crashes per hour", xaxis = list(showgrid = FALSE, zeroline = FALSE, showticklabels = FALSE),
|
||||||
|
Loading…
Reference in New Issue
Block a user