Relevant: Dynamic column resizing in .Rprofile
If I attempt to pass Sys.getenv("COLUMNS")
as an integer (or as numeric or as is, i.e., as a string) to the parameter width
of options()
in my user .Rprofile, I get an error upon startup:
Error in options(width = as.integer(Sys.getenv("COLUMNS"))):
invalid 'width' parameter, allowed 10...10000
However, if, once logged into an interactive session, I try the same manually, no error is thrown and getOption("width")
returns a value identical to as.integer(Sys.getenv("COLUMNS"))
.
I'd like to know why it doesn't work from my .Rprofile, especially since something similar appears in the examples given on the help page for Startup. I am using R in xterm and am on Linux (Arch).