Re: [Rd] How to build R without support for translations?

2017-02-21 Thread Henrik Bengtsson
On Tue, Feb 21, 2017 at 7:00 PM, Dirk Eddelbuettel  wrote:
>
> On 21 February 2017 at 18:45, Henrik Bengtsson wrote:
> | In Section 'Localization of messages' of R Installation and
> | Administration (R 3.3.2), it says:
> |
> |"R can be built without support for translations, but it is enabled
> | by default."
> |
> | How can this be done?  Is this an option to 'configure', which I then
> | failed to identify, or via some environment variable setting?
>
> To a first approximation:  ensure configure fails that sub-tests by not
> having the corresponding -dev package.  More elaborately, turn the
> corresponding configure variable to 'no'.

To identify and manually disable / fail all relevant configure tests
was the answer I feared.

>
> | My objective is to get an R installation (on Linux) that is as small
> | as possible.
>
> I considered playing that game a couple of years ago and decided that it is
> more or less a waste of time: as good as 'R the interpreter' is, the real
> added value (at least to me) comes from the *incredible* power supplied by
> the *massive* number *perfectly well working add-on* packages from CRAN.
>
> Which nixes the idea of a minimal size. R really is /usr/bin/R plus whatever
> you want from CRAN.  So for you, what use in reducing R by 10% if you can't
> add the 'future' package?  Not to mention that many packages may need a
> compiler, or a beast like BH, or ...

I'm aware this question comes up once in a while.  One immediate
interest is running R on Amazon Lambda, which only allows for
deploying a 50 MB ZIP file / 250 MB uncompressed
(http://docs.aws.amazon.com/lambda/latest/dg/limits.html). So, an
obvious ~7 MB reduction can be valuable / critical there.

Thanks,

Henrik

>
> Dirk
>
> --
> http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] How to build R without support for translations?

2017-02-21 Thread Dirk Eddelbuettel

On 21 February 2017 at 18:45, Henrik Bengtsson wrote:
| In Section 'Localization of messages' of R Installation and
| Administration (R 3.3.2), it says:
| 
|"R can be built without support for translations, but it is enabled
| by default."
| 
| How can this be done?  Is this an option to 'configure', which I then
| failed to identify, or via some environment variable setting?

To a first approximation:  ensure configure fails that sub-tests by not
having the corresponding -dev package.  More elaborately, turn the
corresponding configure variable to 'no'.
 
| My objective is to get an R installation (on Linux) that is as small
| as possible.

I considered playing that game a couple of years ago and decided that it is
more or less a waste of time: as good as 'R the interpreter' is, the real
added value (at least to me) comes from the *incredible* power supplied by
the *massive* number *perfectly well working add-on* packages from CRAN.

Which nixes the idea of a minimal size. R really is /usr/bin/R plus whatever
you want from CRAN.  So for you, what use in reducing R by 10% if you can't
add the 'future' package?  Not to mention that many packages may need a
compiler, or a beast like BH, or ...

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] How to build R without support for translations?

2017-02-21 Thread Henrik Bengtsson
In Section 'Localization of messages' of R Installation and
Administration (R 3.3.2), it says:

   "R can be built without support for translations, but it is enabled
by default."

How can this be done?  Is this an option to 'configure', which I then
failed to identify, or via some environment variable setting?

My objective is to get an R installation (on Linux) that is as small
as possible.

Thanks,

Henrik

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] [FORGED] Re: Replaying a recorded plot (mixed base and grid) from pdf() in cairo_pdf() crashes R

2017-02-21 Thread Yihui Xie
Thanks a lot! I don't use cairo_pdf() very often. I discovered this
problem because a user reported an issue with cairo_pdf() in knitr,
and I found it was reproducible without using knitr.

Regards,
Yihui
--
https://yihui.name


On Tue, Feb 21, 2017 at 5:32 PM, Paul Murrell  wrote:
> Hi
>
> I decided to blame cairo_pdf().
>
> There is a fix in r-devel (r72242) that works for the reported case, plus
> some basic sanity checks.
>
> I could not complete 'make check-devel' because it was failing on
> reg-tests-1d.R ...
>
>> stopifnot(length(fd) == 10, identical(fd, format(dct <- as.POSIXct(dlt
> Error: identical(fd, format(dct <- as.POSIXct(dlt))) is not TRUE
>
> ... anyone else seeing that ?
>
> I would appreciate confirmation from a heavier user of cairo_pdf() that I
> have not broken anything.
>
> Paul
>
>
> On 21/02/17 08:27, Paul Murrell wrote:
>>
>> Hi
>>
>> This appears to be happening (at least) because cairo_pdf() delays
>> initialising a Cairo surface until BM_NewPage(), rather than
>> initiliasing a Cairo surface in BM_Open(), and replayPlot() triggers
>> some activity (set clip region) on the device BEFORE a new page is
>> started (so the pointer to the Cairo surface is null, so BOOM).
>>
>> Not sure yet whether to blame replayPlot() for not starting with a new
>> page operation OR to blame cairo_pdf() for not initialising a Cairo
>> surface at device startup.
>>
>> If anyone who knows more about Cairo (or cairo_pdf()) wants to point out
>> a good reason for the way cairo_pdf() currently works, please don't hold
>> back.
>>
>> Paul
>>
>> On 21/02/17 05:30, Yihui Xie wrote:
>>>
>>> A quick follow-up: I just used cairo_pdf() as the recording device,
>>> and it crashes R as well, so it is probably not relevant to pdf() but
>>> an issue specific to cairo_pdf().
>>>
>>> cairo_pdf()
>>> dev.control('enable')
>>>
>>> library("grid")
>>> plot(1)
>>> grid.text("A")
>>>
>>> res = recordPlot()
>>> dev.off()
>>>
>>> cairo_pdf()
>>> replayPlot(res)
>>> dev.off()
>>>
>>>
>>> Regards,
>>> Yihui
>>> --
>>> https://yihui.name
>>>
>>>
>>> On Mon, Feb 20, 2017 at 10:24 AM, Yihui Xie  wrote:

 Hi,

 I wonder if this is expected or I'm doing a wrong thing.

 pdf()
 dev.control('enable')

 library("grid")
 plot(1)
 grid.text("A")

 res = recordPlot()
 dev.off()

 cairo_pdf()
 replayPlot(res)
 dev.off()


  *** caught segfault ***
 address 0x4, cause 'memory not mapped'


> sessionInfo()

 R version 3.3.2 (2016-10-31)
 Platform: x86_64-apple-darwin13.4.0 (64-bit)
 Running under: macOS Sierra 10.12.3

 locale:
 [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

 attached base packages:
 [1] stats graphics  grDevices utils datasets  methods   base

 loaded via a namespace (and not attached):
 [1] tools_3.3.2 yaml_2.1.14

 Regards,
 Yihui
 --
 https://yihui.name
>>>
>>>
>>> __
>>> R-devel@r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>>
>>
>
> --
> Dr Paul Murrell
> Department of Statistics
> The University of Auckland
> Private Bag 92019
> Auckland
> New Zealand
> 64 9 3737599 x85392
> p...@stat.auckland.ac.nz
> http://www.stat.auckland.ac.nz/~paul/

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] [FORGED] Re: Replaying a recorded plot (mixed base and grid) from pdf() in cairo_pdf() crashes R

2017-02-21 Thread Paul Murrell

Hi

I decided to blame cairo_pdf().

There is a fix in r-devel (r72242) that works for the reported case, 
plus some basic sanity checks.


I could not complete 'make check-devel' because it was failing on 
reg-tests-1d.R ...


> stopifnot(length(fd) == 10, identical(fd, format(dct <- 
as.POSIXct(dlt

Error: identical(fd, format(dct <- as.POSIXct(dlt))) is not TRUE

... anyone else seeing that ?

I would appreciate confirmation from a heavier user of cairo_pdf() that 
I have not broken anything.


Paul

On 21/02/17 08:27, Paul Murrell wrote:

Hi

This appears to be happening (at least) because cairo_pdf() delays
initialising a Cairo surface until BM_NewPage(), rather than
initiliasing a Cairo surface in BM_Open(), and replayPlot() triggers
some activity (set clip region) on the device BEFORE a new page is
started (so the pointer to the Cairo surface is null, so BOOM).

Not sure yet whether to blame replayPlot() for not starting with a new
page operation OR to blame cairo_pdf() for not initialising a Cairo
surface at device startup.

If anyone who knows more about Cairo (or cairo_pdf()) wants to point out
a good reason for the way cairo_pdf() currently works, please don't hold
back.

Paul

On 21/02/17 05:30, Yihui Xie wrote:

A quick follow-up: I just used cairo_pdf() as the recording device,
and it crashes R as well, so it is probably not relevant to pdf() but
an issue specific to cairo_pdf().

cairo_pdf()
dev.control('enable')

library("grid")
plot(1)
grid.text("A")

res = recordPlot()
dev.off()

cairo_pdf()
replayPlot(res)
dev.off()


Regards,
Yihui
--
https://yihui.name


On Mon, Feb 20, 2017 at 10:24 AM, Yihui Xie  wrote:

Hi,

I wonder if this is expected or I'm doing a wrong thing.

pdf()
dev.control('enable')

library("grid")
plot(1)
grid.text("A")

res = recordPlot()
dev.off()

cairo_pdf()
replayPlot(res)
dev.off()


 *** caught segfault ***
address 0x4, cause 'memory not mapped'



sessionInfo()

R version 3.3.2 (2016-10-31)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: macOS Sierra 10.12.3

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats graphics  grDevices utils datasets  methods   base

loaded via a namespace (and not attached):
[1] tools_3.3.2 yaml_2.1.14

Regards,
Yihui
--
https://yihui.name


__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel





--
Dr Paul Murrell
Department of Statistics
The University of Auckland
Private Bag 92019
Auckland
New Zealand
64 9 3737599 x85392
p...@stat.auckland.ac.nz
http://www.stat.auckland.ac.nz/~paul/

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] R CMD build error during vignettes build

2017-02-21 Thread Sebastian P. Luque
Hello,

I'm trying to rebuild a package (using R version 3.3.2 (2016-10-31))
that has not seen any changes since it was last built without problems
in previous R versions.  It fails during vignette building with:

------
$ R CMD build diveMove
* checking for file ‘diveMove/DESCRIPTION’ ... OK
* preparing ‘diveMove’:
* checking DESCRIPTION meta-information ... OK
* installing the package to build vignettes
* creating vignettes ... ERROR
Quitting from lines 432-438 (diveMove.Rnw) 
Error: processing vignette 'diveMove.Rnw' failed with diagnostics:
missing values and NaN's not allowed if 'na.rm' is FALSE
Execution halted
------

There are no problems running the R code resulting from tangling the
vignette.  Specifically, the code referred to in the error is a single
function call, which returns with no warnings or errors, so I have
little to hold on to.  How can I get more verbose debug from "R CMD
build"?

-- 
Seb

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] possible improvement to ?with examples

2017-02-21 Thread Martin Maechler
> Ben Bolker 
> on Thu, 16 Feb 2017 15:37:13 -0500 writes:

> A querent on StackOverflow asked about the with() function
> 
http://stackoverflow.com/questions/42283479/why-when-to-use-with-function#42283479

> and asked about the example in ?with

> library(MASS)
> with(anorexia, {
>  anorex.1 <- glm(Postwt ~ Prewt + Treat + offset(Prewt),
> family = gaussian)
>  summary(anorex.1)
> })

> which saves little or no typing relative to

> anorex.1 <- glm(Postwt ~ Prewt + Treat + offset(Prewt),
> family = gaussian, data=anorexia)

> (I would argue that the latter is better practice anyway).

> Could we have something more sensible like

> with(mtcars,mpg[cyl==8 & disp>350])

> ?  (It could be contrasted directly with

> mtcars$mpg[mtcars$cyl==8 & mtcars$disp>350]

> )

I now have done something like the above, and have added a
\note{ .. }  to warn about "over - use" of with().

Also added a link to Thomas Lumley's paper
  Thomas Lumley (2003)  \emph{Standard nonstandard evaluation rules}.
  \url{http://developer.r-project.org/nonstandard-eval.pdf}

> I'm happy to submit a bug report/patch if that seems appropriate.

Thank you, Ben!
Martin

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel