I have this code I put in R Shiny :
case_when(tesdata$note <= 10 ~ "≤",
tesdata$note > 10 ~ "≥")
It should return ≤ if the value is less than or equal to 10 and ≥ if the value is more than 10.
However it won't give me the special character and instead return the code itself "≤"
.
How do I make it return the special character?
You can use the unicode equivalent.
testdata %>%
mutate(
newcolumn = case_when(
note <= 10 ~ "\u2264", # ≤
note > 10 ~ "\u2265", # ≥
TRUE ~ "\u2245" # ≅
)
)