GUI" settin...">

Set font and font size to R Console programmatically?

Is it possible to set the font and font size, as is the case with the "Edit-> GUI" settings, programmatically ? What will the function look like for this? I am in the windows.

+5
source share
1 answer

On Windows (at least), the configuration file $R_HOME/etc/Rconsolesets many additional options for the console and pager. Here is a section that you can edit manually to change the default font and font size:

## Font.
# Please use only fixed width font.
# If font=FixedFont the system fixed font is used; in this case
# points and style are ignored. If font begins with "TT ", only
# True Type fonts are searched for.
font = TT Courier New
points = 10
style = normal # Style can be normal, bold, italic

R, loadRconsole(). , , , , Rconsole R. :

temp <- tempfile()
cat("points = 13\n", file = temp)
cat("style = italic\n", file = temp, append = TRUE)
loadRconsole(file = temp)

## And then, to reset to the defaults:
loadRconsole(file = file.path(R.home(), "etc/Rconsole"))
+7

All Articles