It's html so use <br>. I made this poptext in a loop.
poptext = paste(poptext,
paste(
"<br><b>",
case_when(
!is.na(obs_displayname[names(temp)]) ~ unname(obs_displayname[names(temp)]),
TRUE ~ names(temp)
),
"</b> = ",
case_when(
sapply(temp, is.character) ~ unlist(temp),
sapply(temp, is.factor) ~ paste(sapply(temp, as.character), "(mode)"),
names(temp) %in% "CHLA92" ~ paste(signif(as_numeric(temp), 3), "(92nd percentile)"),
TRUE ~ paste(signif(as_numeric(temp), 3), "(median)")
),
collapse = "")
)
# This can generate a whole table from the dataframe (this pops up on an AwesomeMarker)
addAwesomeMarkers(data = df,
~x, ~y, icon = icons,
popup = ~htmlTable(df[,1:6], rnames = FALSE,
header = c("Year","M.(GNA/ha)","M.(GNA%)",
"M.(EQR)", "Soft Mud", "ETI")))