I would also love to find out how to make changes to the way edit() -- or in my case, View(), but that's presumably using the same resources -- looks under Linux. On my 4K display, the font size is so small as to be barely readable. I would assume this requires some adjustment to .Xresources, but I don't know what keys might be relevant. Searching through the source code didn't give me any clues. See also: https://stackoverflow.com/questions/64459416/how-to-change-text-font-and-size-in-r-view The only mention of Xresources I could find were under ?X11, but this pertains to plots, not edit() and View(). I asked about this on R-sig-Debian in 2017: https://stat.ethz.ch/pipermail/r-sig-debian/2017-October/002776.html I don't think I ever followed this up on R-devel (where maybe this belongs), so happy to move this there if nobody here has any suggestions. Best, Wolfgang>-----Original Message----- >From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of Jeremie Juste >Sent: Saturday, 30 April, 2022 11:54 >To: R-help at R-project.org >Subject: [R] customizing edit.data.frame > >Hello, > >I was wondering how to customize the grid color of the GUI from the following >command? > >edit(data.frame()) > >The default grid color is red while on linux it is black. I also found >out that one can customize the mentioned color using the native R GUI in >the menu preferences. After saving the preferences a file named Rconsole >is created. > >I would like to know if there is a way to set the grid color directly >when launching R from the terminal or RStudio or ESS? > >Best regards, >Jeremie
On Mon, 2 May 2022 11:09:55 +0000 "Viechtbauer, Wolfgang (NP)" <wolfgang.viechtbauer at maastrichtuniversity.nl> wrote:> I would also love to find out how to make changes to the way edit() > -- or in my case, View(), but that's presumably using the same > resources -- looks under Linux.Looking at the source code [*], there is a way to set the font using an undocumented option, but the its size is still hard-coded to "12 pt": https://github.com/r-devel/r-svn/blob/d3e0e30f6da8ab81f24b04690a9a52d81603b189/src/modules/X11/dataentry.c#L1924 (Those are bitmap fonts intended for a fixed DPI which is likely different from yours, which is why the font size measured in points is wrong. I'm not an X11 expert, so I don't know whether this is possible, but I've never seen these fonts packaged for more than 100 DPI.) It's possible to get the desired result by passing a string with fixed parameters instead of %s, %s, %d precisely in the right places, but that's undefined behaviour and not intended to work this way: stopifnot(l10n_info()$MBCS) options(X11fonts = "-*-courier-%s-%s-*-*-34-*-*-*-*-*-*-*") View(1) (See the xfontsel command for what XLFD font names should look like and X11Fonts() for what R expects to find in that option.) -- Best regards, Ivan