Skip to content

Commit

Permalink
fix of flight duration computation in geopressureviz
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafnuss committed Jun 29, 2022
1 parent 31462cb commit 964b558
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions inst/geopressureviz/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ server <- function(input, output, session) {
flight_duration <- c()
for (i_f in seq_len(max(0, length(idx_sta_short) - 1))) {
from_idx_sta_short <- idx_sta_short[i_f]
to_idx_sta_short <- idx_sta_short[i_f + 1]
to_idx_sta_short <- idx_sta_short[i_f + 1] - 1

flight_duration[i_f] <- sum(
do.call(rbind, lapply(
Expand Down Expand Up @@ -74,7 +74,7 @@ server <- function(input, output, session) {
HTML(
"<b>Previous flight:</b><br>",
as.numeric(input$i_sta) - idx_sta_prev, " flights -",
round(fl_dur[i - 1]), " hrs<br>",
round(fl_dur[i - 1], 1), " hrs<br>",
round(dist), " km - ",
round(dist / fl_dur[i - 1]), "km/h"
)
Expand All @@ -97,7 +97,7 @@ server <- function(input, output, session) {
HTML(
"<b>Next flight:</b><br>",
idx_sta_next - as.numeric(input$i_sta), " flights -",
round(sum(fl_dur[i])), " hrs<br>",
round(sum(fl_dur[i]), 1), " hrs<br>",
round(dist), " km - ",
round(dist / fl_dur[i]), "km/h"
)
Expand Down

0 comments on commit 964b558

Please sign in to comment.