Home > front end >  Remove space between symbol and text when using 'expression'
Remove space between symbol and text when using 'expression'

Time:07-06

I want to use the function 'expression' in r to be able to add symbols as '≤' Example:

plot(1:10,1:10)
legend(3,8, c(expression(""<="test ")))

With this code there will be a space between ≤ and test, I want there to be no space: ≤test, how to accomplish this? Thanksenter image description here

CodePudding user response:

You could use unicode symbols (\U2264 for ) and do it without the expression?

plot(1:10,1:10)
legend(3,8, "\U2264test") # legend(3,8, "≤test")

enter image description here

  •  Tags:  
  • r
  • Related