On Wed, 15 Nov 2006, Dirk Eddelbuettel wrote:

I am truly sorry but I have a hard time understanding what it is that you
want to do in this email.

Inferring from your Normale Sup email address, I presume you are in France
and want a4 paer.   Is that correct?

yes.

Furthermore, does

        $ paperconf

say 'a4' as the reply?

yes.

| result as yours (that is: letter).
|
|
| After your patch (with 2.4.0.20061103-1), I am getting:
| R_PAPERSIZE_USER='a4'
| R_PAPERSIZE=${R_PAPERSIZE-'letter'}

That is the desired behaviour. If R sees R_PAPERSIZE_USER set, it will use it
and override R_PAPERSIZE.  So you should get a4.

| This is not what I expected, I thought I was supposed to get:
| R_PAPERSIZE_USER=${R_PAPERSIZE}
| R_PAPERSIZE=${R_PAPERSIZE-'a4'}

I was trying for that once, but that does not work that way since R 2.4.0
(see the NEWS file).  What this does is set R_PAPERSIZE_USER to R_PAPERSEIZE
--- but R_PAPERSIZE is undefined on Debian (as we do not set env. vars by
default).  So you just created an emptu R_PAPERSIZE_USER which will confuse R>

| I now have:
| stedding ~ $ echo 'print(options("papersize"))' | R --slave
| $papersize
| [1] "a4"

Correct.

| stedding ~ $ export R_PAPERSIZE=letter
| stedding ~ $ echo 'print(options("papersize"))' | R --slave
| $papersize
| [1] "a4"
| (should be letter I guess)

No. Debian does not use environment variables. You are supposed to set
papersize with

$ /usr/sbin/paperconfig -p letter

after which you would have to run the r-base-core postinst. [ Actually, and
that will only alter a factory setting so it won't do anything in this case. ]

Your environment variable clashes with the config file, and the config file
does not respect / listen to the env var. So the env var is a null-op.

Here is the behavior I expect from R: by default it should use the global paperconf setting, but this should be overridable by the user (I don't care how, whether it is locale or some other environment variable). This was achieved (before the LC_PAPER introduction) with:
R_PAPERSIZE_USER=${R_PAPERSIZE}
R_PAPERSIZE=${R_PAPERSIZE-'a4'}
which uses a4 by default unless the user specified a R_PAPERSIZE setting (seems to me that PAPERSIZE would be more standard, but never mind)

I am using your line:
echo 'print(options("papersize"))' | R --slave
to check what papersize is used.

With the config file as you are providing it, I (simple user) cannot override the default setting of a4, because setting R_PAPERSIZE or R_PAPERSIZE_USER is ignored, and so is setting LC_PAPER (because R_PAPERSIZE_USER is not empty after reading the config file).

It does not confuse R at all to have an empty R_PAPERSIZE_USER, and what I proposed behaves as documented in the NEWS file. But then that does not use paperconf. The only way to use paperconf would be to remove the use of the locale in src/library/profile/Rprofile.unix:

    lcpaper <- Sys.getlocale("LC_PAPER") # might be null: OK as nchar is 0
    papersize <- if(nchar(lcpaper))
        if(length(grep("(_US|_CA)", lcpaper)) > 0) "letter" else "a4"
    else Sys.getenv("R_PAPERSIZE")
==>
    papersize <- Sys.getenv("R_PAPERSIZE")


So there are basically 2 choices:
1) act as documented in the R NEWS file (R_PAPERSIZE then LC_PAPER)
2) act as we used to (R_PAPERSIZE then paperconf)

As maintainer I guess it is your choice to decide between the 2 (I don't care), but both are better than just using paperconf.

Is this email more clear? Don't hesitate to write again if I still don't make sense.

--
Marc Glisse


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to