[Tex/LaTex] LaTeX “command” /incantation for R

r

I am using the tufte-handout class in LaTeX and I want to refer to R using the "correct" sans-serif font. I am currently using

\newcommand{\R}{ {\bf \sffamily R } }

used as …

... function in the \verb|spatstat| \R package ...

What LaTeX "command" / incantation would you use?

Best Answer

If you want to ensure a sans serif upright bold font, just define

\newcommand{\R}{\textnormal{\sffamily\bfseries R}}}

If you want to avoid typing \R{} is a nice program, then

\usepackage{xspace}
\newcommand{\R}{\textnormal{\sffamily\bfseries R}}\xspace}

will allow

\R is a nice program