diff --git a/R/calcInstantRisk.R b/R/calcInstantRisk.R index 15628a0745bfe1e6291bc291db3d5bea19b60b8f..d03bd95b453d30828c558b39b59863188c2b7b0f 100644 --- a/R/calcInstantRisk.R +++ b/R/calcInstantRisk.R @@ -49,7 +49,7 @@ calcInstantRisk <- function(con, ruleset, date, storages, n = 10L) { NULL } }) - names(l) <- paste(objectives$station, objectives$level, "Q", + names(l) <- paste(station_names[objectives$station], objectives$level, "Q", ifelse(objectives$flood, "<", ">"), objectives$threshold, "m3/s") df <- data.frame(id_objective = seq.int(nrow(objectives)), diff --git a/R/calcRiskHeatMap.R b/R/calcRiskHeatMap.R index 35a5b79f1ed69b96fd90e99be253304bed712230..044b878d887f7952fd0bcfe616c89cf10ff593ce 100644 --- a/R/calcRiskHeatMap.R +++ b/R/calcRiskHeatMap.R @@ -17,7 +17,7 @@ calcRiskHeatMap <- function(con, ruleset, station, level, lake) { dataLength <- length(which(cdf$id_cal_day == calday)) if(dataLength > 1) { l <- approx(cdf$V[cdf$id_cal_day == calday], cdf$prob[cdf$id_cal_day == calday], discretStorage, rule = 2) - data.frame(julian = i, day = calday, V = l$x, prob = round(l$y, digits = 1)) + data.frame(julian = i, day = calday, V = l$x, prob = round(l$y *20)/20) } else if(dataLength == 1){ data.frame(julian = i, day = calday, V = discretStorage, prob = 0) } else { diff --git a/R/mod_one_objective_focus.R b/R/mod_one_objective_focus.R index 07047e96dc4fa2b275930f73a6f0b6786694e2fb..e105eac089e899a6b41d8096c4284fa7548ad892 100644 --- a/R/mod_one_objective_focus.R +++ b/R/mod_one_objective_focus.R @@ -13,7 +13,7 @@ mod_one_objective_focus_ui <- function(id){ rulesets <- seq(length(rvgest::rulesets$rules)) names(rulesets) <- paste0(rulesets, ". ", rvgest::rulesets$rules) stations <- unique(rvgest::objectives$station) - names(stations) <- stations + names(stations) <- station_names levels <- unique(rvgest::objectives$level) names(levels) <- levels tagList( @@ -67,7 +67,6 @@ mod_one_objective_focus_server <- function(id, con, SGL_RT_storage){ names(levels) <- paste(objectives$level, "Q", ifelse(objectives$flood, "<", ">"), objectives$threshold, "m3/s") - golem::print_dev(levels) updateSelectInput(session, inputId = "level", choices = levels) }) diff --git a/R/station_names.R b/R/station_names.R new file mode 100644 index 0000000000000000000000000000000000000000..84db6f984780160c5d932d026761789bcee68c32 --- /dev/null +++ b/R/station_names.R @@ -0,0 +1,10 @@ +station_names <- strsplit("Arcis-sur-Aube +Mery-sur-Seine +Nogent-sur-Seine +Gurgy (Yonne) +Courlon-sur-Yonne +Alfortville (Seine) +Chalons-sur-Marne +Noisiel (Marne) +Paris (Seine)", "\n")[[1]] +names(station_names) <- unique(rvgest::objectives$station)