Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Displaying a greater than or equal sign

I have a plot which is generated thus:

ggplot(dt.2, aes(x=AgeGroup, y=Prevalence)) +      geom_errorbar(aes(ymin=lower, ymax=upper), colour="black", width=.2) +     geom_point(size=2, colour="Red") 

I control the x axis labels like this:

scale_x_discrete(labels=c("0-29","30-49","50-64","65-79",">80","All")) + 

This works but I need to change the ">80" label to "≥80".

However "≥80" is displayed as "=80".

How can I display the greater than or equal sign ?

like image 978
Robert Long Avatar asked Nov 02 '12 09:11

Robert Long


People also ask

How do you display greater than or equal to?

Greater than or equal to is represented by the symbol "≥". For example, x ≥ −2 means the value of x is greater than or equal to -2.

How do you type ≥?

Using Alt Decimal Code Hold one of the alt keys on your keyboard and type the decimal code from the above table. For example, alt + 8805 will make greater than or equal to symbol like ≥.

How do you type the greater than symbol on a laptop?

On English PC and Mac keyboards, the greater than symbol is on the same key as the period. Pressing and holding down the Shift , and then pressing > creates the greater than symbol.

How do you show the greater than sign?

The greater than symbol is >. So, 9>7 is read as '9 is greater than 7'. The less than symbol is <. Two other comparison symbols are ≥ (greater than or equal to) and ≤ (less than or equal to).


1 Answers

An alternative to using expressions is Unicode characters, in this case Unicode Character 'GREATER-THAN OR EQUAL TO' (U+2265). Copying @mnel's example

.d <- data.frame(a = letters[1:6], y = 1:6)  ggplot(.d, aes(x=a,y=y)) + geom_point() +      scale_x_discrete(labels = c(letters[1:5], "\u2265 80")) 

Unicode is a good alternative if you have trouble remembering the complicated expression syntax or if you need linebreaks, which expressions don't allow. As a downside, whether specific Unicode characters work at all depends on your graphics device and font of choice.

like image 104
otsaw Avatar answered Sep 20 '22 06:09

otsaw