0

I would like to create an arrow as a character variable in R. (Specifically, I would like a right arrow, a left arrow, and a double-headed arrow.) I have looked up some lists of unicode symbols for arrows (e.g., here), but I have not been able to figure out the syntax to set a character variable to be an arrow.

As an example of what I am looking for, if I input "\U00B5" I get the character variable "µ". What is the analogous code for a unicode arrow?

Ben
  • 1,051
  • 8
  • 26
  • Have you seen? https://stackoverflow.com/questions/52020256/unicode-variable-names-in-r What problems are you having exactly? What OS are you on? – MrFlick Dec 18 '20 at 03:41
  • My first problem is that I don't know what code R recognises for arrows. I have tried variations of the unicode values in the link and they don't work. My OS is windows. (From the linked question it looks like this problem might be more complicted than I thought.) – Ben Dec 18 '20 at 05:01
  • I don't really understand what you are getting at. R uses `<-` for assignment, but that's not a single character. It doesn't have any other "special" arrows. If you want to use a unicode arrow, that wouldn't be any different than any other unicode value. And you do what to use the arrow as a variable name, not not a variable value? – MrFlick Dec 18 '20 at 05:04
  • Then can you show me the code to print a unicode arrow as a variable? – Ben Dec 18 '20 at 05:07
  • ---e.g., If I input ```"\U00B5"``` I get a character variable that is ```µ```. What is the analogous code for an arrow? – Ben Dec 18 '20 at 05:08
  • 1
    One such example is `"\U2190"`. Here's a page with a list of codes: https://unicode.org/charts/nameslist/n_2190.html. Just use the 4 character code after a `\U` in your string. – MrFlick Dec 18 '20 at 05:10
  • Wonderful! If you would like to make that an answer, I would be happy to accept! – Ben Dec 18 '20 at 05:11

0 Answers0