Re: [R] Numerical stability of: 1/(1 - cos(x)) - 2/x^2

2023-08-16 Thread Iris Simmons
You might also be able to rewrite log(1 - cos(x)) as log1p(-cos(x)) On Wed, Aug 16, 2023, 02:51 Iris Simmons wrote: > You could rewrite > > 1 - cos(x) > > as > > 2 * sin(x/2)^2 > > and that might give you more precision? > > On Wed, Aug 16, 2023, 01:50 Leonard Mada via R-help > wrote: > >> D

Re: [R] Numerical stability of: 1/(1 - cos(x)) - 2/x^2

2023-08-16 Thread Martin Maechler
> Iris Simmons > on Wed, 16 Aug 2023 02:57:48 -0400 writes: > You might also be able to rewrite > log(1 - cos(x)) > as > log1p(-cos(x)) > On Wed, Aug 16, 2023, 02:51 Iris Simmons wrote: >> You could rewrite >> >> 1 - cos(x) >> >> as >

[R] R - Problem retrieving memory used after gc() using arrow library

2023-08-16 Thread Kévin Pemonon
Hello, I'm using R versions 4.1.3 on Windows 10 and I'm having a problem with memory usage. Currently, I need to use the arrow and dplyr libraries in a program and when I compare the memory used between the windows task manager and the memory.size(max=F) function, the one given by the windows tas

Re: [R] R - Problem retrieving memory used after gc() using arrow library

2023-08-16 Thread Ivan Krylov
On Wed, 16 Aug 2023 11:22:00 +0200 Kévin Pemonon wrote: > I'd like to understand why there's a difference in memory used > between the Windows task manager and R's memory.size(max=F) function. When R was initially ported to Windows, then-popular version of the system memory allocator was not a g

Re: [R] Numerical stability of: 1/(1 - cos(x)) - 2/x^2

2023-08-16 Thread Leonard Mada via R-help
Dear Iris, Dear Martin, Thank you very much for your replies. I add a few comments. 1.) Correct formula The formula in the Subject Title was correct. A small glitch swept into the last formula: - 1/(cos(x) - 1) - 2/x^2 or 1/(1 - cos(x)) - 2/x^2 # as in the subject title; 2.) log1p Actually, the

[R] X11 font

2023-08-16 Thread Therneau, Terry M., Ph.D. via R-help
I get the following error out of R, on a newer Ubuntu installation. Error in `axis()`: ! X11 font -adobe-helvetica-%s-%s-*-*-%d-*-*-*-*-*-*-*, face 1 at size 12 could not be loaded Backtrace:  1. graphics::matplot(...)  3. graphics::plot.default(...)  4. graphics (local) localAxis(...)  6. gr

Re: [R] X11 font

2023-08-16 Thread Ben Bolker
There's an ancient related question ... maybe it helps? https://stat.ethz.ch/pipermail/r-help//2016-October/442326.html sudo apt-get install xfonts-100dpi sudo-apt-get install xfonts-75dpi apt-cache search xfonts doesn't pull up anything else obvious (presumably you already have xfonts-base

[R] MASS::mvrnorm() on MKL may produce different numbers even when the seed is the same?

2023-08-16 Thread Shu Fai Cheung
Hi All, When addressing an error in one of my packages in the CRAN check at CRAN, I found something strange which, I believe, is unrelated to my package. I am not sure whether it is a bug or a known issue. Therefore, I would like to have advice from experts here. The error at CRAN check occurred