Re: [Rd] R test coverage

2023-11-27 Thread Jim Hester
It should be possible to use covr to do this, see this old issue (https://github.com/r-lib/covr/issues/59). However interpreting the results can prove challenging as naturally covr uses functions from the base internally. Unfortunately the base and many of the internal and recommended packages have

Re: [Rd] [External] Possible ALTREP bug

2021-05-28 Thread Jim Hester
>From reading the discussion on the Bioconductor issue tracker it seems like the reason the GC is not suspended for the non-string ALTREP Elt methods is primarily due to performance concerns. If this is the case perhaps an additional flag could be added to the `R_set_altrep_*()` functions so ALTRE

Re: [Rd] Sys.timezone() fails on Linux under Microsoft WSL

2021-04-26 Thread Jim Hester
One way to avoid the call to timedatectl is to set the `TZ` environment variable on your machine to your local timezone, if this is set `Sys.timezone()` uses this and does not try to query timedatectl for the timezone. This is a common issue as well in docker containers, as like on WSL in docker t

Re: [Rd] subset data.frame at C level

2020-06-23 Thread Jim Hester
It looks to me like internally .subset2 uses `get1index()`, but this function is declared in Defn.h, which AFAIK is not part of the exported R API. Looking at the code for `get1index()` it looks like it just loops over the (translated) names, so I guess I just do that [0]. [0]: https://github.co

Re: [Rd] defining r audio connections

2020-05-07 Thread Jim Hester
https://github.com/jimhester/archive was not allowed on CRAN when I submitted it 3 years ago due to this restriction. Being able to write custom connections is a useful feature for a number of applications, I would love this policy to be reconsidered. On Wed, May 6, 2020 at 10:30 PM Henrik Bengts

[Rd] Add a new environment variable switch for the 'large version' check

2020-04-15 Thread Jim Hester
If you test a package with `R CMD check --as-cran` one of the 'incoming' checks is for a large version number, it gives a NOTE like this * checking CRAN incoming feasibility ... NOTE Maintainer: ‘Jim Hester ’ Version contains large components (0.0.0.9000) This is a useful

Re: [Rd] Suggestion/opinions: add a `absolute` param to `normalizePath()` to force returning an absolute path

2020-04-15 Thread Jim Hester
The fs[1] function `fs::path_abs()` does what I believe you were expecting `normalizePath()` to do in this case. e.g. setwd("~") normalizePath("foo/bar") #> Warning in normalizePath("foo/bar") : #> path[1]="foo/bar": No such file or directory #> [1] "foo/bar" fs::path_abs(

[Rd] ALTREP string methods for substr and nchar

2019-12-19 Thread Jim Hester
A useful extension of ALTREP is having two new string methods which return the number of characters of a given string element and to return a substring of an element. Having these methods would allow retrieving these values without needing to create a CHARSXP for the full element data, which could

Re: [Rd] install_github and survival

2019-09-09 Thread Jim Hester
I just sent a PR that makes a few small changes to the package and fixes the installation with `install_github()` (and also `R CMD INSTALL`) and other ways of installing the package. https://github.com/therneau/survival/pull/84 Jim On Thu, Sep 5, 2019 at 1:53 PM Therneau, Terry M., Ph.D. via R-d

Re: [Rd] Underscores in package names

2019-08-15 Thread Jim Hester
Martin, Thank you for discussing this amongst R-core and for detailing the R-core discussion here. Some specific examples where having underscores available would have been useful. 1. My primerTree package (2013) was originally primer_tree, but I had to change the name to camelCase to comply wit

Re: [Rd] Underscores in package names

2019-08-09 Thread Jim Hester
To be clear, I'd be happy to contribute code to make this work, with the changes mentioned by Duncan and elsewhere in the codebase, if someone on R-core was interested in reviewing it. Jim On Thu, Aug 8, 2019 at 11:05 AM Duncan Murdoch wrote: > > On 08/08/2019 10:31 a.m., Jim H

[Rd] Underscores in package names

2019-08-08 Thread Jim Hester
Are there technical reasons that package names cannot be snake case? This seems to be enforced by `.standard_regexps()$valid_package_name` which currently returns "[[:alpha:]][[:alnum:].]*[[:alnum:]]" Is there any technical reason this couldn't be altered to accept `_` as well, e.g. "[[:alp

[Rd] Use of C++ in Packages

2019-03-29 Thread Jim Hester
First, thank you to Tomas for writing his recent post[0] on the R developer blog. It raised important issues in interfacing R's C API and C++ code. However I do _not_ think the conclusion reached in the post is helpful > don’t use C++ to interface with R There are now more than 1,600 packages o

Re: [Rd] Package inclusion in R core implementation

2019-03-04 Thread Jim Hester
Conversely, what is the process to remove a package from core R? It seems to me some (many?) of the packages included are there more out of historical accident rather than any technical need to be in the core distribution. Having them as a core (or recommended) package makes them harder update inde

[Rd] Using `--configure.args` with configure.win on Windows

2018-12-20 Thread Jim Hester
Looking at the code for `R CMD INSTALL` [1] it looks like `--configure-args` is not used on Windows, so there is not a way to pass arguments to the `configure.win` script like there is for `configure`. Is this lack intentional or simply an oversight because support for configure.win was added late

[Rd] Change windows installer default to only install 64 bit R

2018-11-09 Thread Jim Hester
The R Installer by default installs both the 32 and 64 bit versions of R. This can cause user confusion as they have multiple versions of R installed and are then unsure which to use, or mistakenly open the wrong version. We can remove much of this ambiguity by changing the default choice in the i

Re: [Rd] substitute() on arguments in ellipsis ("dot dot dot")?

2018-08-15 Thread Jim Hester
Assuming you are fine with a pairlist instead of a list avoiding the `as.list()` call for dots2 saves a reasonable amount of time and makes it clearly the fastest. library(rlang) dots1 <- function(...) as.list(substitute(list(...)))[-1L] dots2 <- function(...) as.list(substitute(...())) dots2.5 <

Re: [Rd] R CMD build then check fails on R-devel due to serialization version

2018-01-11 Thread Jim Hester
This change poses difficulties for automated build systems such as travis-ci, which is widely used in the R community. In particular because this is a WARNING and not a NOTE this causes all R-devel builds with vignettes to fail, as the default settings fail the build if R CMD check issues a WARNING

Re: [Rd] Wish List: base::source() + Add Execution Time Argument

2017-12-21 Thread Jim Hester
R does provide the addTaskCallback / taskCallbackManager to run a callback function after every top level command. However there is not an equivalent interface that would be run _before_ each command, which would make it possible to time of top level calls and provide other execution measurements.

Re: [Rd] write.csv

2017-07-04 Thread Jim Hester
On linux at least you can use `/dev/full` [1] to test writing to a full device. > echo 'foo' > /dev/full bash: echo: write error: No space left on device Although that won't be a perfect test for this case where part of the file is written successfully. An alternative suggestion for test

Re: [Rd] The ByteCompile & LazyLoading fields

2017-07-04 Thread Jim Hester
In WRE [1] it states > Several optional fields take logical values: these can be specified as ‘yes’, > ‘true’, ‘no’ or ‘false’: capitalized values are also accepted. And if you look at the source [2], [3] you will see exactly what values this entails. [1]: https://cran.r-project.org/doc/manual

Re: [Rd] R history: Why 'L; in suffix character ‘L’ for integer constants?

2017-06-16 Thread Jim Hester
The relevant sections of the C standard are http://c0x.coding-guidelines.com/5.2.4.2.1.html, which specifies that C ints are only guaranteed to be 16 bits, C long ints at least 32 bits in size, as Peter mentioned. Also http://c0x.coding-guidelines.com/6.4.4.1.html specifies l or L as the suffix for

[Rd] Consider increasing the size of HSIZE

2017-05-16 Thread Jim Hester
The HSIZE constant, which sets the size of the hash table used to store symbols is currently defined as `#define HSIZE 4119`. This value was last increased in r5182 on 1999-07-15. https://github.com/jimhester/hashsize#readme contains a code which simulates a normal R workflow by loading a handful

Re: [Rd] Support for user defined unary functions

2017-03-17 Thread Jim Hester
#x27;d propose coopting unary @ for that myself. After off list > discussions with Jonathan Carrol and with Michael Lawrence I think it's > doable, unambiguous, and even imo pretty intuitive for an "unquote" > operator. > > Best, > ~G > > On Fri, Mar 17,

Re: [Rd] Support for user defined unary functions

2017-03-17 Thread Jim Hester
pelled out stuff like %foo%), it's hard to >> see the advantage vs. foo(x). >> >> Those examples you mention should probably be addressed (eventually) in the >> core language, and it looks like people are already able to experiment, so >> I'm not sure there'

Re: [Rd] Support for user defined unary functions

2017-03-17 Thread Jim Hester
might > be found, does "a %chr% %chr% b" mean "%chr%(a, %chr% b)", or is it a syntax > error (like typing "a %chr%(%chr%(b))" would be)? > > Duncan Murdoch > > > > > > On 16/03/2017 10:24 AM, Jim Hester wrote: >> >> R has long suppo

Re: [Rd] Support for user defined unary functions

2017-03-16 Thread Jim Hester
nyway. > > Best, > ~G > > > > On Thu, Mar 16, 2017 at 9:51 AM, Martin Maechler > wrote: >> >> >>>>> Jim Hester >> >>>>> on Thu, 16 Mar 2017 12:31:56 -0400 writes: >> >> > Gabe, >> > The unary fun

Re: [Rd] Support for user defined unary functions

2017-03-16 Thread Jim Hester
perations would be of the same precedence (or just slightly below?) > built-in unary ones? So > > "100" %identical% %chr% 100 > > would work and return TRUE under your patch? > > And with %num% <- as.numeric, then > > 1 + - %num% "5" > > woul

[Rd] Support for user defined unary functions

2017-03-16 Thread Jim Hester
R has long supported user defined binary (infix) functions, defined with `%fun%`. A one line change [1] to R's grammar allows users to define unary (prefix) functions in the same manner. `%chr%` <- function(x) as.character(x) `%identical%` <- function(x, y) identical(x, y) %chr% 100

[Rd] unloadNamespace() does not address unevaluated promises in the S3 Methods Table

2015-12-22 Thread Jim Hester
Given the extremely simple package at https://github.com/jimhester/testUnload, which includes only one S3 method 'print.object' the following code produces a lazy load error from a new R session (R-devel r69801) install.packages("testUnload", repos = NULL) library("testUnload") unloadNamespace("te

Re: [Rd] Mapping parse tree elements to tokens

2015-07-29 Thread Jim Hester
he branch of the parse tree, as Michael suggests. > > etc. Which is best for your purposes? > > Duncan Murdoch > > >> Michael >> >> On Wed, Jul 29, 2015 at 9:43 AM, Duncan Murdoch >> wrote: >> > On 29/07/2015 12:13 PM, Jim Hester wrote: >>

[Rd] Mapping parse tree elements to tokens

2015-07-29 Thread Jim Hester
I would like to map the parsed tokens obtained from utils::getParseData() to the parse tree and elements obtained by base::parse(). It looks like back when this code was in the parser package the parse() function annotated the elements in the tree with their id, which would allow you to perform th

Re: [Rd] LDFLAGS defined in R_MAKEVARS_USER file is ignored for R CMD SHLIB on Windows

2015-05-13 Thread Jim Hester
y issue. On Mon, May 11, 2015 at 12:28 PM, Jim Hester wrote: > Example input and output to reproduce this can be found at > https://gist.github.com/jimhester/b7f05f50794c88e44b17. > > I tested this attempting to compile the [digest]( > http://cran.r-project.org/web/packages

[Rd] LDFLAGS defined in R_MAKEVARS_USER file is ignored for R CMD SHLIB on Windows

2015-05-11 Thread Jim Hester
Example input and output to reproduce this can be found at https://gist.github.com/jimhester/b7f05f50794c88e44b17. I tested this attempting to compile the [digest]( http://cran.r-project.org/web/packages/digest/index.html) package, `run.sh` and `run.bat` were both run in the package source directo