ghcnm / utils /generateLabel.R
alexdum's picture
feat: Add GHCN-M precipitation data processing, loading, and visualization capabilities to the application.
f34a7ac
raw
history blame contribute delete
617 Bytes
# Function to generate labels
generateLabel <- function(name, id, elevation, first_year, last_year, mean_value, selected_years, country, value_label_prefix = "Mean Temp:", units = "°C") {
paste(
"Station:", name, "<br>",
"Country:", country, "<br>",
"ID:", id, "<br>",
"Elevation:", elevation, "m<br>",
"Available years:", first_year, "-", last_year, "<br>",
"Selected years:", selected_years[1], "-", selected_years[2], "<br>",
value_label_prefix, round(mean_value, 1), units,
"<br><span style='color:red;'>Click to get graph and data</span>"
) %>%
lapply(htmltools::HTML)
}