Home > Blockchain >  list all available symbols in R
list all available symbols in R

Time:02-28

The following code from Plot a heart in R gives me how to draw hearts, clubs, spaces, and diamonds in R.

clubs <- expression(symbol('\247'))
hearts <- expression(symbol('\251'))
diamonds <- expression(symbol('\250'))
spades <- expression(symbol('\252'))
csymbols <- c(clubs, hearts, diamonds, spades)

plot( 0, xlim=c(0,5), ylim=c(0,2), type="n" )
clr <- c("black", "red", "red", "black") 
for (i in 1:4) {
  hline <- function( yloc, ... ) 
         for (i in 1:length(yloc)) 
             lines( c(-1,6), c(yloc[i],yloc[i]), col="gray")  
              hline(0.9); 
                hline(1.0);
                hline(1.1);
                hline(1.2)  
 text( i, 1, csymbols[i], col=clr[i], cex=5 )  
 text( i, 0.5, csymbols[i], col=clr[i] ) }

The help in symbol lists quite a few more. However, I was wondering how to get the entire list corresponding to the different values in the "\xxx" where xxx are the digits. Any suggestions?

Just to clarify, I am looking for the symbols list corresponding to the different strings. For instance, in the above '\247' corresponds to clubs, '\252' corresponds to spades and so on. I am looking for the entire list of these digits in the character string.

CodePudding user response:

From ?symbol,

The symbol font uses Adobe Symbol encoding

You can find tables of that in several places. When I searched, one of the top results is hosted at R-Core memeber Paul Murrell's page at the Auckland Statistics Dept.

  •  Tags:  
  • r
  • Related