[Rd] zapsmall(x) for scalar x

2023-12-16 Thread Gregory Warnes
I was quite suprised to discover that applying `zapsmall` to a scalar value has no apparent effect. For example: > y <- 2.220446e-16 > zapsmall(y,) [1] 2.2204e-16 I was expecting zapsmall(x)` to act like > round(y, digits=getOption('digits')) [1] 0 Looking at the current source code,

Re: [Rd] [External] Re: 1954 from NA

2021-05-25 Thread Gregory Warnes
As a side note, for floating point values, the IEEE 754 standard provides for a large set of NaN values, making it possible to have multiple types of NAs for floating point values... Sent from my iPad > On May 25, 2021, at 3:03 PM, Avi Gross via R-devel > wrote: > > That helps get more

Re: [Rd] the pipe |> and line breaks in pipelines

2020-12-09 Thread Gregory Warnes
Many languages allow a final backslash (“\”) character to allow an expression to span multiple lines, and I’ve often wished for this in R, particularly to allow me to put `else` on a separate line at the top-level. It would also allow alignment of infix operators like the new pipe operator `|>`

Re: [Rd] anonymous functions

2020-12-07 Thread Gregory Warnes
Thanks for expressing this eloquently. I heartily agree. On Mon, Dec 7, 2020 at 12:04 PM Therneau, Terry M., Ph.D. via R-devel < r-devel@r-project.org> wrote: > “The shorthand form \(x) x + 1 is parsed as function(x) x + 1. It may be > helpful in making > code containing simple function

Re: [Rd] [External] Re: New pipe operator

2020-12-07 Thread Gregory Warnes
My vote is for the consistency of function calls always having parentheses, including in pipes. Making them optional only saves two keystrokes, but will add yet another inconsistency to confuse or trip folks up. As for the new anonymous function syntax, I would prefer something more human

Re: [Rd] New pipe operator

2020-12-05 Thread Gregory Warnes
If we’re being mathematically pedantic, the “pipe” operator is actually function composition. That being said, pipes are a simple and well-known idiom. While being less than mathematically exact, it seems a reasonable label for the (very useful) behavior. On Sat, Dec 5, 2020 at 9:43 PM Abby

Re: [Rd] .Internal(quit(...)): system call failed: Cannot allocate memory

2020-11-23 Thread Gregory Warnes
Try explicitly deleting large data objects by calling `rm`, then `gc`. On Mon, Nov 23, 2020 at 6:15 AM Tomas Kalibera wrote: > On 11/21/20 6:51 PM, Jan Gorecki wrote: > > Dear R-developers, > > > > Some of the more fat scripts (50+ GB mem used by R) that I am running, > > when they finish they

Re: [Rd] status of Java & rJava?

2020-03-28 Thread Gregory Warnes
Hi Spencer, I'm also having problems getting rJava to work on Mac OS X. -G On Sat, Mar 28, 2020 at 4:19 PM Spencer Graves wrote: > Hello, All: > > >Is Java being deprecated for R? > > >I ask, because I've been unable to get rJava 0.9-11 to work under > either macOS 10.15 or

Re: [Rd] (no) circular dependency

2016-04-08 Thread Gregory Warnes
A third possibility, which I use in my gtools and gdata packages, is to use soft-links to create a copy of the relevant functions from one package in the other. I make sure these functions are *not* exported, so no conflicts are created, and the use of soft-links mean the code never gets out

Re: [Rd] Interactiveness

2007-12-11 Thread Gregory Warnes
You might also find many of the tools provided in the 'session' package helpful for interacting with R in this way. 'session' package description: Utility functions for interacting with R processes from external programs. This package includes functions to save and restore session

Re: [Rd] errors in loading packages (PR#9839)

2007-08-10 Thread Gregory Warnes
Another way of answering the question: The gmodels and gregmisc package both depend on the gtools package. Either install that first, or tell R to install all dependencies. From the command line: install.packages(..., depends=TRUE) or the equivalent checkbox in the UI. -G On