Skip to content

Commit

Permalink
#279; add maximum value of the measurements to the table
Browse files Browse the repository at this point in the history
  • Loading branch information
tennere committed Feb 20, 2024
1 parent dee9ec2 commit b19e6a5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions modules/add_metadata_param_tables.R
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,17 @@ metadata_param_server <- function(id,
last_m = last_m,
n_obs = sum(!is.na(value)),
max_obs = as.numeric(timerange),
per_obs = round(n_obs/max_obs*100) ) %>%
per_obs = round(n_obs/max_obs*100),
max_value = round(max(value),0)) %>%
dplyr::distinct(station, .keep_all = T) %>%
dplyr::ungroup()

# Add the station information to the measurements
# Keep all stations from the station_data
metadata_table <- data_stations_part %>%
dplyr::left_join(metadata_table, by = "station") %>%
dplyr::select(c(station, group_name, per_obs, max_obs, first_m, last_m,
dplyr::select(c(station, group_name, per_obs, max_obs, max_value,
first_m, last_m,
station_type, selected, col))

# Only show selected station
Expand Down Expand Up @@ -142,6 +144,7 @@ metadata_param_server <- function(id,
colnames = c("Station" = "station",
"Group" = "group_name",
"Datacapture %" = "per_obs",
"Maximum value" = "max_value",
"First measurements" = "first_m",
"Last measurements" = "last_m",
"Type" = "station_type"),
Expand Down

0 comments on commit b19e6a5

Please sign in to comment.