Hi Community,
I want to apply this code to a list of similar dataframes - DATAFRAMES_2[i] - instead of to a single dataframe - scores
formattable(scores, list(
prev_score = formatter("span",
style = ~style(display = "block",
font.weight = "bold",
color = "white",
"border-radius" = "4px",
"padding-right" = "4px",
"background-color" =
ifelse(change > 0,"darkblue",
ifelse(change == 0,"blue",
ifelse(change <0, "lightblue",NA)))))
I tried to use this code:
for(i in 1:length(DATAFRAMES_2)) {
formattable(DATAFRAMES_2[i], list(
Casa = formatter("span",
style = ~style(display = "block",
font.weight = "bold",
color = "white",
"border-radius" = "4px",
"padding-right" = "4px",
"background-color" =
ifelse(Casa %in% CLUBES_CASA,"chartreuse4",NA)))))
}
But I got this erroe message:
Error in create_obj(x, "formattable", list(formatter = formatter, format = list(...), :
argument "formatter" is missing, with no default
Can you help me please?