# 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, "
", "Country:", country, "
", "ID:", id, "
", "Elevation:", elevation, "m
", "Available years:", first_year, "-", last_year, "
", "Selected years:", selected_years[1], "-", selected_years[2], "
", value_label_prefix, round(mean_value, 1), units, "
Click to get graph and data" ) %>% lapply(htmltools::HTML) }