How to change output for N/A on tables using formattable package in R

I would like to remove the arrow when it's not a percent.

my R code is :


list( "Evolution" = formatter("span"
 , style = x ~ formattable::style(color = ifelse(x == "Données sur T-1 non disponibles", "grey"
 ,ifelse(x>0 & x!="Inf" & x != "NaN", "green"
 ,ifelse(x<0 & x != "NaN","red","grey"))))
                                                                    
 , x ~ icontext( ifelse(x < 0, "arrow-down", "arrow-up") , x))

Any idea ??
Thanks :slight_smile:

change the icontext logic

x ~ icontext(ifelse(is.numeric(x), ifelse(x < 0, "arrow-down", "arrow-up"),
    NA_character_
  ), x)

Many thanks, it works :smiley: