Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Specifying the font in an R console - multiplatform solutions?

Tags:

r

console

fonts

This is fairly mundane as R questions go, but I would like to specify the font in my R console. It's easy enough to do in Windows - John Cook has an excellent little writeup on that.

However, that is specific for the Windows R GUI. I'm not able to find a way to do this (at least from within R) on RStudio, Linux, etc. Is there a global, platform-agnostic solution? If not, what would need to be wrapped to make this feasible given per-platform idiosyncracies?

Or is this infeasible?

Note that I'm interested in the font family, rather than the font size, though font size suggestions are welcome.

Edit: I plan to apply this inside a program, if possible. Since R can make calls to the shell, I am happy with a two-pass method that first configures external files in preparation for a subsequent invocation of R, if that is necessary.

like image 795
Iterator Avatar asked Aug 02 '11 21:08

Iterator


People also ask

What font does R console use?

The default installation of R on Windows uses Courier New for the console font.

How do I change the font size in R studio?

Then, you can further adjust the font of code window, console, terminal, environment, and history panels via Tools >> Global Options >> Appearance >> Editor font size.


2 Answers

No, each of the front-ends to R are responsible for the way that the console is displayed to the user. This will be inherently platform and front-end specific.

like image 134
Gavin Simpson Avatar answered Oct 29 '22 09:10

Gavin Simpson


I believe that Gavin is right: this is set per frontend, and I fail to find anything for Linux. However, the standard R frontend for Windows is addressed in my question. Mac users may find this page helpful: Permanently change default console font.

So, the answers as I found them may be summarized as:

  • Windows / default R - see John Cook's page
  • Mac - see link above
  • Linux / default R frontend - not possible (or am I wrong?)
  • (Windows, Mac, Linux) / Rstudio - Font family is not available (yet) - see this page. Font size is - this page
  • Windows / Revolution R - this page
  • Other / Revolution R - not found

So, the universal trick is that I need to use R via a web server, and then I can configure my browser. :) Not going to happen. I'll wait on Rstudio.

like image 38
Iterator Avatar answered Oct 29 '22 10:10

Iterator