[Rd] Is it possible to gracefully interrupt a child R process on MS Windows?

2025-05-11 Thread Henrik Bengtsson
In help("pskill", package = "tools") is says: Only SIGINT and SIGTERM will be defined on Windows, and pskill will always use the Windows system call TerminateProcess. As far as I understand it, TerminateProcess [1] terminates the process "quite abruptly". Specifically, it is not possible for th

Re: [Rd] structure(, ...) is sticky: a bug, or should it be an error?

2025-04-05 Thread Henrik Bengtsson
fixing this in R 4.5.0, I'll make this a top priority. Please let me know. /Henrik On Thu, Mar 20, 2025 at 3:31 AM Martin Maechler wrote: > > >>>>> Henrik Bengtsson > >>>>> on Wed, 19 Mar 2025 10:58:46 -0700 writes: > > > Hello. >

Re: [Rd] structure(, ...) is sticky: a bug, or should it be an error?

2025-04-04 Thread Henrik Bengtsson
On Fri, Mar 21, 2025 at 8:55 AM Martin Maechler wrote: > > >>>>> Martin Maechler > >>>>> on Fri, 21 Mar 2025 14:49:16 +0100 writes: > > >>>>> Henrik Bengtsson > >>>>> on Thu, 20 Mar 2025 11:55:05 -

Re: [Rd] structure(, ...) is sticky: a bug, or should it be an error?

2025-04-02 Thread Henrik Bengtsson
you considered making it a warning of class 'deprecatedWarning'? Not a big deal, but wanted to mention it, just in case. /Henrik On Fri, Mar 21, 2025 at 10:07 AM Henrik Bengtsson wrote: > > On Fri, Mar 21, 2025 at 8:55 AM Martin Maechler > wrote: > > > > >>>&

[Rd] Suppressed "graphical parameter" warnings reviving themselves magically

2025-03-22 Thread Henrik Bengtsson
What's going on here? $ R --vanilla --quiet > plot.new(); suppressWarnings({ points(0, 0, foo = TRUE) }) > NULL NULL Warning messages: 1: "foo" is not a graphical parameter 2: "foo" is not a graphical parameter Note how the warnings are revived in that second "NULL" call. I can reproduce this in

[Rd] structure(, ...) is sticky: a bug, or should it be an error?

2025-03-19 Thread Henrik Bengtsson
Hello. I just (re-)discovered that structure(sum, init = 100) is "sticky", i.e. it stays with base::sum(). Here's an minimal example: $ R --vanilla --quiet > void <- structure(sum, some_attr = TRUE) > str(sum) function (..., na.rm = FALSE) - attr(*, "some_attr")= logi TRUE >From my very basic t

Re: [Rd] Depends: R (>= 4.1) for packages that use |> and \(...)

2025-01-16 Thread Henrik Bengtsson
Thanks for looking into this and the patch. FWIW, there's an open PR18105 - "R CMD build: Add dependency on R >= 4.1.0 if code uses pipe symbol |>" for this (https://bugs.r-project.org/show_bug.cgi?id=18105). /Henrik On Thu, Jan 16, 2025 at 3:42 AM Ivan Krylov via R-devel wrote: > > Hello R-deve

Re: [Rd] Package compression benchmarks for zstd vs gzip

2025-01-11 Thread Henrik Bengtsson
Can't speak for Jeroen, but it sounds like it's worth adding support for tar.zstd package files, just like how tar.gz, tar.xz, and tar.bzip2 are currently supported. I'd also argue for support zstd compression throughout R, including adding zstdfile(), support for saveRDS(..., compress = "zstd"), a

Re: [Rd] [External] Re: Is ALTREP "non-API"?

2024-04-24 Thread Henrik Bengtsson
On Wed, Apr 24, 2024 at 1:32 PM luke-tierney--- via R-devel wrote: > > On Wed, 24 Apr 2024, Hadley Wickham wrote: > > >> > >> > >> > > That is not true at all - the presence of header does not constitute > declaration of something as the R API. There are cases where internal > functi

Re: [Rd] Wish: a way to track progress of parallel operations

2024-03-25 Thread Henrik Bengtsson
Hello, thanks for bringing this topic up, and it would be excellent if we could come of with a generic solution for this in base R. It is one of the top frequently asked questions and requested features in parallel processing, but also in sequential processing. We have also seen lots of variants

Re: [Rd] Ordered comparison operators on language objects will signal errors

2024-03-04 Thread Henrik Bengtsson
On Mon, Mar 4, 2024 at 8:45 AM luke-tierney--- via R-devel wrote: > > Comparison operators == and != can be used on language objects > (i.e. call objects and symbols). The == operator in particular often > seems to be used as a shorthand for calling identical(). The current > implementation involv

Re: [Rd] round.Date and trunc.Date not working / implemented

2024-02-08 Thread Henrik Bengtsson
Technically, there is a round() for 'Date' objects, but it doesn't seem very useful, because it basically just fall back to the default round() method, which only takes the 'digits' argument. Here's an example: > date <- Sys.Date() > class(date) [1] "Date" We see that there are only two round()

Re: [Rd] [EXTERNAL] Re: NOTE: multiple local function definitions for ?fun? with different formal arguments

2024-02-06 Thread Henrik Bengtsson
Here's a dummy example that I think illustrates the problem: toto <- function() { if (runif(1) < 0.5) function(a) a else function(a,b) a+b } > fcn <- toto() > fcn(1,2) [1] 3 > fcn <- toto() > fcn(1,2) [1] 3 > fcn <- toto() > fcn(1,2) Error in fcn(1, 2) : unused argument (2) How can y

Re: [Rd] tools::startDynamicHelp(): Randomly prevents R from exiting (on MS Windows)

2024-01-06 Thread Henrik Bengtsson
> > > > > > ---- Original Message > On Jan 6, 2024, 12:38, Henrik Bengtsson < henrik.bengts...@gmail.com> wrote: > > > ISSUE: On MS Windows, running cmd.exe, calling Rscript --vanilla -e "port <- > tools::startDynamicHelp(); port; port <-

[Rd] tools::startDynamicHelp(): Randomly prevents R from exiting (on MS Windows)

2024-01-06 Thread Henrik Bengtsson
ISSUE: On MS Windows, running cmd.exe, calling Rscript --vanilla -e "port <- tools::startDynamicHelp(); port; port <- tools::startDynamicHelp(FALSE); port" will sometimes stall R at the end, preventing it from existing. This also happens when running R in interactive mode. It seems to stem fro

Re: [Rd] capture error messages from loading shared objects

2023-11-28 Thread Henrik Bengtsson
Careful; tryCatch() on non-error conditions will break out of what's evaluated, e.g. res <- tryCatch({ cat("1\n") message("2") cat("3\n") 42 }, message = identity) will output '1' but not '3', because it returns as soon as the first message() is called. To "record" messages (same for war

Re: [Rd] dim<-() changed in R-devel; no longer removing "dimnames" when doing dim(x) <- dim(x)

2023-11-01 Thread Henrik Bengtsson
s change too :) The discussion on whether certain R expressions (e.g. dim(x) <- dim(x)) should be no-op is interesting, but it's much bigger, and I can see how it becomes a quite complicated discussion. Thanks, Henrik On Mon, Oct 30, 2023 at 3:53 AM Martin Maechler wrote: > > &g

[Rd] dim<-() changed in R-devel; no longer removing "dimnames" when doing dim(x) <- dim(x)

2023-10-29 Thread Henrik Bengtsson
Hello, the fix of PR18612 (https://bugs.r-project.org/show_bug.cgi?id=18612) in r85380 (https://github.com/wch/r-source/commit/2653cc6203fce4c48874111c75bbccac3ac4e803) caused a change in `dim<-()`. Specifically, in the past, any `dim<-()` assignment would _always_ remove "dimnames" and "names"

Re: [Rd] Bug report: parLapply with capture.output(type="message") produces an error

2023-10-05 Thread Henrik Bengtsson
This is actually not a bug. If we really want to identify a bug, then it's actually a bug in your code. We'll get to that at the very end. Either way, it's an interesting report that reveals a lot of things. First, here's a slightly simpler version of your example: $ Rscript --vanilla -e 'library

Re: [Rd] save.image Non-responsive to Interrupt

2023-05-04 Thread Henrik Bengtsson
On Thu, May 4, 2023 at 3:02 PM Serguei Sokol via R-devel wrote: > > Le 03/05/2023 à 01:25, Henrik Bengtsson a écrit : > > Along the lines of calling R_CheckUserInterrupt() only onces in a while: > > > >> OTOH, in the past we have had to *disable* R_CheckUserInterrupt(

Re: [Rd] save.image Non-responsive to Interrupt

2023-05-02 Thread Henrik Bengtsson
Along the lines of calling R_CheckUserInterrupt() only onces in a while: > OTOH, in the past we have had to *disable* R_CheckUserInterrupt() > in parts of R's code because it was too expensive, > {see current src/main/{seq.c,unique.c} for a series of commented-out > R_CheckUserInterrupt() for su

Re: [Rd] [External] subfolders in the R folder

2023-03-28 Thread Henrik Bengtsson
A quick drive-by-comment: What if 'R CMD build' would have an option to flatten R/ subfolders when building the tarball, e.g. R/unix/a.R R/windows/a.R R/a.R becomes: R/00__unix__a.R R/00__windows__a.R R/a.R ? Maybe that would be sufficient for most use cases. The only thing I can imagine is t

[Rd] CRAN 'R Sources' page: Provide link to https://svn.r-project.org/R/

2023-03-19 Thread Henrik Bengtsson
Not sure who is the webadmin for https://cran.r-project.org/sources.html, so posting it here: I just noticed it's not straightforward to find the Subversion URL for the R source code. A natural search would be to go to https://cran.r-project.org/, then click 'Source code' to get to https://cran.r

[Rd] WISH: Optional mechanism preventing var <<- value from assigning non-existing variable

2023-03-19 Thread Henrik Bengtsson
I'd like to be able to prevent the <<- assignment operator ("super assignment") from assigning to the global environment unless the variable already exists and is not locked. If it does not exist or is locked, I'd like an error to be produced. This would allow me to evaluate expressions with this

Re: [Rd] Request: better default R_LIBS_USER

2023-03-16 Thread Henrik Bengtsson
> Your best bet really to govern your .libPaths from your Rprofile.site and Renviron.site ... To do this for any version of R, one can add: R_LIBS_USER=~/.local/share/R/%p-library/%v to ~/.Renviron or the Renviron.site file. This automatically expands to the platform and R x.y version early on w

Re: [Rd] Compiling R-devel on older Linux distributions, e.g. RHEL / CentOS 7

2023-02-08 Thread Henrik Bengtsson
On Wed, Feb 8, 2023 at 12:22 PM Iñaki Ucar wrote: > > On Wed, 8 Feb 2023 at 19:59, Henrik Bengtsson > wrote: > > > > I just want to add a few reasons that I know of for why users are > > still on Red Hat/CentOS 7 and learned from being deeply involved with > &g

Re: [Rd] need help from someone know screen reader and R high DPI GUI

2023-02-08 Thread Henrik Bengtsson
Thanks for this work. My suggestion would be to provide those pre-built Windows binaries to maximize the chances to get the feedback you need. The amount of people ready to, or have the setup to, build R from source, especially so on MS Windows, is much smaller than those who are willing to give it

Re: [Rd] Compiling R-devel on older Linux distributions, e.g. RHEL / CentOS 7

2023-02-08 Thread Henrik Bengtsson
I just want to add a few reasons that I know of for why users are still on Red Hat/CentOS 7 and learned from being deeply involved with big academic and research high-performance compute (HPC) environments. These systems are not like your regular sailing boat, but more like a giant container ship;

Re: [Rd] Sys.getenv(): Error in substring(x, m + 1L) : invalid multibyte string at '' if an environment variable contains \xFF

2023-01-30 Thread Henrik Bengtsson
;t want to make a decision. > > I don't have a strong opinion on this, but Sys.getenv("FOO") and > Sys.getenv()[["FOO"]] should not yield two different results. I would argue > that if we want to make specific checks, we should make them conditional - > eve

[Rd] Sys.getenv(): Error in substring(x, m + 1L) : invalid multibyte string at '' if an environment variable contains \xFF

2023-01-30 Thread Henrik Bengtsson
/Hello. SUMMARY: $ BOOM=$'\xFF' LC_ALL=en_US.UTF-8 Rscript --vanilla -e "Sys.getenv()" Error in substring(x, m + 1L) : invalid multibyte string at '' $ BOOM=$'\xFF' LC_ALL=en_US.UTF-8 Rscript --vanilla -e "Sys.getenv('BOOM')" [1] "\xff" BACKGROUND: I launch R through an Son of Grid Engine (SGE)

Re: [Rd] R-devel: toLatex() for sessionInfo needs to escape new 'Time zone' entry

2022-12-05 Thread Henrik Bengtsson
I've moved this to https://bugs.r-project.org/show_bug.cgi?id=18443. /Henrik On Wed, Nov 30, 2022 at 2:03 PM Henrik Bengtsson wrote: > > BACKGROUND: > > In recent versions of R-devel, sessionInfo() has a 'tzone' element, e.g. > > > sessionInfo()$tzone >

[Rd] R-devel: toLatex() for sessionInfo needs to escape new 'Time zone' entry

2022-11-30 Thread Henrik Bengtsson
BACKGROUND: In recent versions of R-devel, sessionInfo() has a 'tzone' element, e.g. > sessionInfo()$tzone [1] "America/Los_Angeles" ISSUE: Some time zones, like the one above, has an underscore. This underscore is *not* escaped by utils:::toLatex.sessionInfo, e.g. $ TZ="America/Los_Angeles"

Re: [Rd] Rscript -e EXPR fails to launch if stdin is closed

2022-10-10 Thread Henrik Bengtsson
ailure, not 0, so the test on ifd (and I suppose > > also the one on ifp) is wrong. And of course, once you close file > > descriptor 0, mkstemp() chooses the 1st available fd, i.e. 0, for its > > return value. > > > > -pd > > > >> On 9 Oc

[Rd] Rscript -e EXPR fails to launch if stdin is closed

2022-10-09 Thread Henrik Bengtsson
Rscript fails to launch if the standard input (stdin) is closed, e.g. $ Rscript --vanilla -e 42 0<&- Fatal error: creating temporary file for '-e' failed This appear to only happen with `-e EXPR`, e.g. it works when doing: $ echo "42" > script.R $ Rscript --vanilla script.R 0<&- [1] 42 and: $

Re: [Rd] [External] Time to drop globalenv() from searches in package code?

2022-10-05 Thread Henrik Bengtsson
Excluding the global environment, and all its parent environments from the search path that a package sees would be great news, because it would makes things more robust and probably detect a few more bugs out there. In addition to the use case that Duncan mentions, it would also remove the ambigu

Re: [Rd] Typo in Renviron.site in R 4.2.0 on Ubuntu?

2022-05-08 Thread Henrik Bengtsson
> ... The extra apostrophe does not seem to have created an issue during all > those tests, or since, under either Debian or Ubuntu. I think that is because the system library '/usr/lib/R/library' is always appended at the end of the library path, so that non-existing to folder (the one with the

[Rd] MS Windows: R does not escape quotes in CLI options the same way as Rterm and Rscript

2021-12-15 Thread Henrik Bengtsson
On MS Windows 10, the following works: > Rscript --vanilla -e "\"abc\"" [1] "abc" and also: > Rterm --vanilla --no-echo -e "\"abc.txt\"" [1] "abc.txt" whereas attempting the same with 'R' fails; > R --vanilla --no-echo -e "\"abc.txt\"" Error: object 'abc' not found Execution halted I get this

Re: [Rd] capturing multiple warnings in tryCatch()

2021-12-02 Thread Henrik Bengtsson
Simon's suggestion with withCallingHandlers() is the correct way. Also, note that if you use tryCatch() to catch warnings, you're *interrupting* the evaluation of the expression of interest, e.g. > res <- tryCatch({ message("hey"); warning("boom"); message("there"); 42 }, > warning = function(w)

[Rd] R-devel: as.vector(x, mode = "list") drops attributes despite documented not to

2021-12-01 Thread Henrik Bengtsson
Hi, in R 4.1.2 we have: > x <- structure(as.list(1:2), dim = c(1,2)) > x [,1] [,2] [1,] 12 > as.vector(x, mode = "list") [,1] [,2] [1,] 12 whereas in recent versions of R-devel (4.2.0) we have: > x <- structure(as.list(1:2), dim = c(1,2)) > x [,1] [,2] [1,] 12 > as.ve

[Rd] mapply(): Special case of USE.NAMES=TRUE with recent R-devel updates

2021-11-30 Thread Henrik Bengtsson
Hi, in R-devel (4.2.0), we now get: > mapply(paste, "A", character(), USE.NAMES = TRUE) named list() Now, in ?mapply we have: USE.NAMES: logical; use the names of the first ... argument, or if that is an unnamed character vector, use that vector as the names. This basically says we should get:

Re: [Rd] How can a package be aware of whether it's on CRAN

2021-11-23 Thread Henrik Bengtsson
On Tue, Nov 23, 2021 at 12:06 PM Gábor Csárdi wrote: > > On Tue, Nov 23, 2021 at 8:49 PM Henrik Bengtsson > wrote: > > > > > Is there any reliable way to let packages to know if they are on CRAN, so > > > they can set omp cores to 2 by default? > > >

Re: [Rd] How can a package be aware of whether it's on CRAN

2021-11-23 Thread Henrik Bengtsson
> Is there any reliable way to let packages to know if they are on CRAN, so > they can set omp cores to 2 by default? Instead of testing for "on CRAN" or not, you can test for 'R CMD check' running or not. 'R CMD check' sets environment variable _R_CHECK_LIMIT_CORES_=TRUE. You can use that to lim

[Rd] DOCS: Exactly when, in the signaling process, is option 'warn' applied?

2021-11-18 Thread Henrik Bengtsson
Hi, the following question sprung out of a package settings option warn=-1 to silence warnings, but those warnings were still caught by withCallingHandlers(..., warning), which the package author did not anticipate. The package has been updated to use suppressWarnings() instead, but as I see a lot

[Rd] gettext(msgid, domain="R") doesn't work for some 'msgid':s

2021-11-05 Thread Henrik Bengtsson
I'm trying to reuse some of the translations available in base R by using: gettext(msgid, domain="R") This works great for most 'msgid's, e.g. $ LANGUAGE=de Rscript -e 'gettext("cannot get working directory", domain="R")' [1] "kann das Arbeitsverzeichnis nicht ermitteln" However, it does not

Re: [Rd] BUG?: R CMD check with --as-cran *disables* checks for unused imports otherwise performed

2021-11-02 Thread Henrik Bengtsson
olution at the time (May 2020). See "Dependencies NOTE lost with > --as-cran" (https://stat.ethz.ch/pipermail/r-package-devel/2020q2/005467.html) > > On Wed, Oct 20, 2021 at 11:55 PM Henrik Bengtsson > wrote: >> >> ISSUE: >> >> Using 'R CMD chec

Re: [Rd] Fwd: Using existing envars in Renviron on friendly Windows

2021-11-02 Thread Henrik Bengtsson
environ $ echo "R_LIBS_USER=[${R_LIBS_USER}]" R_LIBS_USER=[C:\Users\foobar\AppData\Roaming\R-library] /Henrik On Sun, Oct 31, 2021 at 2:59 AM Tomas Kalibera wrote: > > > On 10/31/21 2:55 AM, Henrik Bengtsson wrote: > >> ... If one still needed backslashes, > >&g

Re: [Rd] Fwd: Using existing envars in Renviron on friendly Windows

2021-10-30 Thread Henrik Bengtsson
> ... If one still needed backslashes, > they could then be entered in single quotes, e.g. VAR='c:\users'. I don't think it matters whether you use single or double quotes - both will work. Here's a proof of concept on Linux with R 4.1.1: $ cat ./.Renviron A=C:\users B='C:\users' C="C:\users" $

Re: [Rd] Fwd: Using existing envars in Renviron on friendly Windows

2021-10-20 Thread Henrik Bengtsson
Two comments/suggestions: 1. What about recommending to always quote the value in Renviron files, e.g. ABC="Hello world" and DEF="${APPDATA}/R-library"? This should a practice that works on all platforms. 2. What about having readRenviron() escapes strings it imports via environment variables?

[Rd] BUG?: R CMD check with --as-cran *disables* checks for unused imports otherwise performed

2021-10-20 Thread Henrik Bengtsson
ISSUE: Using 'R CMD check' with --as-cran, set_R_CHECK_PACKAGES_USED_IGNORE_UNUSED_IMPORTS_=TRUE, whereas the default is FALSE, which you get if you don't add --as-cran. I would expect --as-cran to check more things and more be conservative than without. So, is this behavior a mistake? Could it

Re: [Rd] R-devel: as.character() for hexmode no longer pads with zeros

2021-09-23 Thread Henrik Bengtsson
is a property we should all strive for for other types of objects? /Henrik On Thu, Sep 23, 2021 at 12:46 AM Martin Maechler wrote: > > >>>>> Henrik Bengtsson > >>>>> on Wed, 22 Sep 2021 20:48:05 -0700 writes: > > > The update in rev 809

[Rd] R-devel: as.character() for hexmode no longer pads with zeros

2021-09-22 Thread Henrik Bengtsson
The update in rev 80946 (https://github.com/wch/r-source/commit/d970867722e14811e8ba6b0ba8e0f478ff482f5e) caused as.character() on hexmode objects to no longer pads with zeros. Before: > x <- structure(as.integer(c(0,8,16,24,32)), class="hexmode") > x [1] "00" "08" "10" "18" "20" > as.character(x

Re: [Rd] WISH: set.seed(seed) to produce error if length(seed) != 1 (now silent)

2021-09-17 Thread Henrik Bengtsson
new .Random.seed value: > > runif(1) > [1] 0.3842704 > > > sum(.Random.seed) > [1] -13435151647 > > # So let's make things really random, by using the new seed as a seed: > > set.seed(.Random.seed) > > sum(.Random.seed) > [1] 24428993419 > > # B

Re: [Rd] WISH: set.seed(seed) to produce error if length(seed) != 1 (now silent)

2021-09-17 Thread Henrik Bengtsson
warning or error with set.seed(). > > Validating inputs and emitting errors early is a good practice. > > Just my 2 cents. > > Sincerely. > Andre GILLIBERT > > -Message d'origine- > De : R-devel [mailto:r-devel-boun...@r-project.org] De la part de Avraham &g

[Rd] WISH: set.seed(seed) to produce error if length(seed) != 1 (now silent)

2021-09-17 Thread Henrik Bengtsson
Hi, according to help("set.seed"), argument 'seed' to set.seed() should be: a single value, interpreted as an integer, or NULL (see ‘Details’). >From code inspection (src/main/RNG.c) and testing, it turns out that if you pass a 'seed' with length greater than one, it silently uses seed[1], e.g

Re: [Rd] Force quitting a FORK cluster node on macOS and Solaris wreaks havoc

2021-08-16 Thread Henrik Bengtsson
Thank you Simon, this is helpful. I take this is specific to quit(), so it's a poor choice for emulating crashed parallel workers, and Sys.kill() is much better for that. I was focusing on that odd extra execution/output, but as you say, there are lots of other things that is done by quit() here,

[Rd] Force quitting a FORK cluster node on macOS and Solaris wreaks havoc

2021-08-12 Thread Henrik Bengtsson
The following smells like a bug in R to me, because it puts the main R session into an unstable state. Consider the following R script: a <- 42 message("a=", a) cl <- parallel::makeCluster(1L, type="FORK") try(parallel::clusterEvalQ(cl, quit(save="no"))) message("parallel:::isChild()=", parallel:

[Rd] R for Windows leaves detritus in the temp directory

2021-06-15 Thread Henrik Bengtsson
ISSUE: The TMPDIR validation done in src/gnuwin32/system.c: /* in case getpid() is not unique -- has been seen under Windows */ snprintf(ifile, 1024, "%s/Rscript%x%x", tm, getpid(), (unsigned int) GetTickCount()); ifp = fopen(ifile, "w+b"); if(!ifp) R_Suicide(_("creation

Re: [Rd] Testing R build when using --without-recommended-packages?

2021-05-05 Thread Henrik Bengtsson
On Wed, May 5, 2021 at 2:13 AM Martin Maechler wrote: > > > Gabriel Becker > > on Tue, 4 May 2021 14:40:22 -0700 writes: > > > Hmm, that's fair enough Ben, I stand corrected. I will say that this > seems > > to be a pretty "soft" recommendation, as these things go, given that

Re: [Rd] Testing R build when using --without-recommended-packages?

2021-05-04 Thread Henrik Bengtsson
uot;) which also produces errors when 'recommended' packages are missing, e.g. "Failed with error: 'there is no package called 'nlme'". (*) BTW, '../bin/R CMD make test-BasePackages' gives "make: *** No rule to make target 'test-BasePack

Re: [Rd] Testing R build when using --without-recommended-packages?

2021-05-04 Thread Henrik Bengtsson
FWIW, $ ./configure --help ... --with-recommended-packages use/install recommended R packages [yes] /Henrik On Tue, May 4, 2021 at 11:17 AM Dirk Eddelbuettel wrote: > > > On 4 May 2021 at 11:07, Henrik Bengtsson wrote: > | Thanks, but I don't unders

Re: [Rd] Testing R build when using --without-recommended-packages?

2021-05-04 Thread Henrik Bengtsson
path on purpose and I'm looking for a way to validate such an installation. If your comment is on the 'stats' examples' hard dependency on 'MASS' despite it's being a suggested packages, I still don't follow. /Henrik On Tue, May 4, 2021 at 10:16 AM Dir

[Rd] Testing R build when using --without-recommended-packages?

2021-05-04 Thread Henrik Bengtsson
I'm on Linux (Ubuntu 18.04). How do I check an R build when using --without-recommended-packages? 'make check' assumes 'recommended' packages are installed, so that fails without them available. DETAILS: When I build R from source without 'recommended' packages: curl -O https://cran.r-project.or

Re: [Rd] R compilation on old(ish) CentOS

2021-04-30 Thread Henrik Bengtsson
Ben, it's most like what Peter says. I can confirm it works; I just installed https://cran.r-project.org/src/base-prerelease/R-latest.tar.gz on an up-to-date CentOS 7.9.2009 system using the vanilla gcc (GCC) 4.8.5 that comes with that version and R compiles just fine and it passes 'make check' to

[Rd] help(".libPaths"): Paragraph lacks mentioning of R_LIBS_SITE

2021-04-19 Thread Henrik Bengtsson
In ?base::.libPaths, there's a paragraph saying: The library search path is initialized at startup from the environment variable R_LIBS (which should be a colon-separated list of directories at which R library trees are rooted) followed by those in environment variable R_LIBS_USER. Only directorie

Re: [Rd] return (x+1) * 1000

2020-11-20 Thread Henrik Bengtsson
Without having dug into the details, it could be that one could update the parser by making a 'return' a keyword and require it to be followed by a parenthesis that optionally contains an expression followed by end of statement (newline or semicolon). Such a "promotion" of the 'return' statement s

Re: [Rd] return (x+1) * 1000

2020-11-20 Thread Henrik Bengtsson
FWIW, 'R CMD check --as-cran' in R-devel checks for "bogus return" statements but I think that's only for the case when one forgets the parentheses, e.g. 'return' instead of 'return()'. I don't think it catches this case but I'm also not sure. Though, I can imagine it might be possible to enhance

Re: [Rd] Process to Incorporate Functions from {parallely} into base R's {parallel} package

2020-11-07 Thread Henrik Bengtsson
rewalls and it's also extremely tedious. Reverse SSH tunneling is super simply; all you need to to is something like: rshopts <- c(sprintf("-R %d:%s:%d", rscript_port, master, port), rshopts) /Henrik On Fri, Nov 6, 2020 at 4:37 PM Duncan Murdoch wrote: > > On 06/11/2020 4

Re: [Rd] Rgui never processes ~/.Renviron

2020-09-09 Thread Henrik Bengtsson
I've "moved" this to https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17919 to make sure it's tracked. /Henrik On Thu, Sep 3, 2020 at 7:25 AM Dirk Eddelbuettel wrote: > > > On 2 September 2020 at 23:38, Henrik Bengtsson wrote: > | WORKAROUND: > | Setting R

[Rd] Rgui never processes ~/.Renviron

2020-09-02 Thread Henrik Bengtsson
ISSUE: It looks like Rgui.exe never processes ~/.Renviron - only ./.Renviron. REPRODUCIBLE EXAMPLE: On Windows, create the following ~/.Renviron and ~/.Rprofile files: C:\Users\alice> Rscript -e "cat('FOO=123\n', file='~/.Renviron')" C:\Users\alice> Rscript -e "cat('print(Sys.getenv(\'FOO\'))', f

[Rd] Bug in stats:::`[.formula`: (~ NULL)[2] gives Error ... missing value where TRUE/FALSE needed

2020-08-14 Thread Henrik Bengtsson
Hi, it looks like: > stats:::`[.formula` function (x, i) { ans <- NextMethod("[") if (length(ans) == 0L || as.character(ans[[1L]])[1L] == "~") { class(ans) <- "formula" environment(ans) <- environment(x) } ans } doesn't like to extract NULL components on either t

Re: [Rd] Restrict package to load-only access - prevent attempts to attach it

2020-07-17 Thread Henrik Bengtsson
gt; > Hi Henrik, > > A bit late, but you can take a look at smbache's {import} package [1] > in case you didn't know it. I believe it does what you are describing. > > [1] https://github.com/smbache/import > > Iñaki > > On Tue, 23 Jun 2020 at 22:21, Henrik Bengtsso

[Rd] Restrict package to load-only access - prevent attempts to attach it

2020-06-23 Thread Henrik Bengtsson
Hi, I'm developing a package whose API is only meant to be used in other packages via imports or pkg::foo(). There should be no need to attach this package so that its API appears on the search() path. As a maintainer, I want to avoid having it appear in search() conflicts by mistake. This means

Re: [Rd] r-project.org SSL certificate issues

2020-06-09 Thread Henrik Bengtsson
Was this resolved upstream or is this something that R should/could fix? If the latter, could this also go into the "emergency release" R 4.0.2 that is scheduled for 2020-06-22? My $.02 /Henrik On Sun, May 31, 2020 at 8:13 AM Gábor Csárdi wrote: > > Btw. it would be also possible to create a m

Re: [Rd] Compatibility issues caused by new simplify argument in apply function

2020-05-22 Thread Henrik Bengtsson
Interesting problem. I'm very rusty on S4 but would one solution be to, already now, add 'simplify = TRUE' to the S4 method and document it; setMethod("apply", signature(X = "Speclib"), function(X, FUN, bySI = NULL, ...,

Re: [Rd] Precision of function mean,bug?

2020-05-20 Thread Henrik Bengtsson
On Wed, May 20, 2020 at 11:10 AM brodie gaslam via R-devel wrote: > > > On Wednesday, May 20, 2020, 7:00:09 AM EDT, peter dalgaard > wrote: > > > > Expected, see FAQ 7.31. > > > > You just can't trust == on FP operations. Notice also > > Additionally, since you're implementing a "mean" function

Re: [Rd] defining r audio connections

2020-05-06 Thread Henrik Bengtsson
What's the gist of the problem of making/having this part of the public API? Is it security, is it stability, is it that the current API is under construction, is it a worry about maintenance load for R Core, ...? Do we know why? It sounds like it's a feature that is useful. I think we missed out

Re: [Rd] mclapply returns NULLs on MacOS when running GAM

2020-04-28 Thread Henrik Bengtsson
ik, > >> > >> That clears things up significantly. I did see the warning but failed to > >> include it my initial email. It sounds like an RStudio issue, and it seems > >> like that it’s quite intrinsic to how forks interact with RStudio. Given &g

Re: [Rd] mclapply returns NULLs on MacOS when running GAM

2020-04-28 Thread Henrik Bengtsson
Hi, a few comments below. First, from my experience and troubleshooting similar reports from others, a returned NULL from parallel::mclapply() is often because the corresponding child process crashed/died. However, when this happens you should see a warning, e.g. > y <- parallel::mclapply(1:2, FU

Re: [Rd] suggestion: "." in [lsv]apply()

2020-04-16 Thread Henrik Bengtsson
I'm sure this exists elsewhere, but, as a trade-off, could you achieve what you want with a separate helper function F(expr) that constructs the function you want to pass to [lsv]apply()? Something that would allow you to write: sapply(split(mtcars, mtcars$cyl), F(summary(lm(mpg ~ wt,.))$r.square

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

2020-04-16 Thread Henrik Bengtsson
I'd second Jim's feature request - it would be useful to be able to disable this in CI and elsewhere.The concept of using an "unusual" version component such as a very large number does a nice job of indicating "unusual" and serves as a blocker for submitting work-in-progress to CRAN by mistake

Re: [Rd] stringsAsFactors

2020-04-13 Thread Henrik Bengtsson
While at it, would it be worth mentioning in the NEWS for R 4.0.0 that options 'stringsAsFactors' is being deprecated, e.g. $ options(stringsAsFactors = TRUE) Warning message: In options(stringsAsFactors = TRUE) : 'options(stringsAsFactors = TRUE)' is deprecated and will be disabled ? Currentl

Re: [Rd] WISH: Sys.setlocale() to return value invisibly

2020-03-25 Thread Henrik Bengtsson
sion. https://bugs.r-project.org/bugzilla/show_bug.cgi?id=15128#c1 /Henrik On Tue, Mar 20, 2018 at 2:11 PM Henrik Bengtsson wrote: > > Contrary to, say, Sys.setenv(), Sys.setlocale() returns it's value > visibly. This means that if you for instance add: > > Sys.setlocal

Re: [Rd] R CMD check --as-cran attempts to hide R_LIBS_USER but fails

2020-03-24 Thread Henrik Bengtsson
cOS - it already worked as wanted on Windows (see, there's some advantages to be on that OS). /Henrik On Wed, Mar 18, 2020 at 9:38 PM Henrik Bengtsson wrote: > > On Wed, Mar 18, 2020 at 8:04 PM Dirk Eddelbuettel wrote: > > > > > > On 18 March 2020 at 19:19, Henri

Re: [Rd] R CMD check --as-cran attempts to hide R_LIBS_USER but fails

2020-03-18 Thread Henrik Bengtsson
On Wed, Mar 18, 2020 at 8:04 PM Dirk Eddelbuettel wrote: > > > On 18 March 2020 at 19:19, Henrik Bengtsson wrote: > | AFAIU, 'R CMD check --as-cran' tries to hide any site and user package > | libraries by setting R_LIBS_SITE and R_LIBS_USER. However, contrary >

[Rd] R CMD check --as-cran attempts to hide R_LIBS_USER but fails

2020-03-18 Thread Henrik Bengtsson
AFAIU, 'R CMD check --as-cran' tries to hide any site and user package libraries by setting R_LIBS_SITE and R_LIBS_USER. However, contrary to R_LIBS_SITE, it fails for R_LIBS_USER and the user's personal library is still available for test scripts. Should I revise my assumptions, or is that inten

Re: [Rd] tcl problem with R-3.6.3?

2020-02-29 Thread Henrik Bengtsson
Here's a simpler example that should reproduce that error for you: ans <- utils::select.list(c("hello", "world", "again"), graphics=TRUE) Does it? FYI, I installed R 3.6.3 from source on CentOS 7 a few hours ago, and for me the above works just fine. For your immediate needs of selecting a CR

Re: [Rd] methods package: A _R_CHECK_LENGTH_1_LOGIC2_=true error

2020-02-14 Thread Henrik Bengtsson
;>>> Martin Maechler > >>>>> on Sat, 29 Jun 2019 10:33:10 +0200 writes: > > >>>>> peter dalgaard > >>>>> on Fri, 28 Jun 2019 16:20:03 +0200 writes: > > >>> > On 28 Jun 2019,

Re: [Rd] as-cran issue ==> set _R_CHECK_LENGTH_1_* settings!

2020-01-14 Thread Henrik Bengtsson
On Tue, Jan 14, 2020 at 1:32 PM Marc Schwartz via R-devel wrote: > > > On Jan 14, 2020, at 3:29 PM, Abby Spurdle wrote: > > > >> I do want to entice people to have a long look beyond closed > >> source OS into the world of Free Software where not only R is > >> FOSS (Free and Open Source Software

Re: [Rd] SUGGESTION: Settings to disable forked processing in R, e.g. parallel::mclapply()

2020-01-11 Thread Henrik Bengtsson
umber of R users we have out there. We have more important things to spend our time on. I can easily count days wasted due to troubleshooting and helping others remotely on problems related to instability of forked processing. Being able to disable it, would have shortcut this quite a bit. /Henrik

Re: [Rd] SUGGESTION: Settings to disable forked processing in R, e.g. parallel::mclapply()

2020-01-10 Thread Henrik Bengtsson
o sequential processing as well. (I'm aware that not all use cases of async processing is about parallelization, so it might not apply everywhere). Cheers, Henrik > > Cheers, > Simon > > > > > On Jan 10, 2020, at 10:58 AM, Henrik Bengtsson > > wrote: > >

Re: [Rd] SUGGESTION: Settings to disable forked processing in R, e.g. parallel::mclapply()

2020-01-10 Thread Henrik Bengtsson
that in principle the functionality requested here can be easily > implemented in a package so R doesn’t need to be modified. > > Cheers, > Simon > > Sent from my iPhone > > >> On Jan 10, 2020, at 04:34, Tomas Kalibera wrote: > >> > >> On 1/10/20 7:3

Re: [Rd] SUGGESTION: Settings to disable forked processing in R, e.g. parallel::mclapply()

2020-01-09 Thread Henrik Bengtsson
I'd like to pick up this thread started on 2019-04-11 (https://hypatia.math.ethz.ch/pipermail/r-devel/2019-April/077632.html). Modulo all the other suggestions in this thread, would my proposal of being able to disable forked processing via an option or an environment variable make sense? I've pro

Re: [Rd] Another wish (?) for R 4.0.0: print(*, width = )

2020-01-07 Thread Henrik Bengtsson
On Tue, Jan 7, 2020 at 6:14 AM brodie gaslam via R-devel wrote: > > For whatever my 2c are worth I think this would be nice. I'm still > uncomfortable at having to call `options` in my package `diffobj` to set > output width. Adding a few more cents: It might be worth considering "who" should

Re: [Rd] switch to reference counting in R-devel

2019-12-03 Thread Henrik Bengtsson
This is very exciting news. Luke, thank you for all your work on this - I know it's been a long journey. All the best, Henrik On Tue, Dec 3, 2019 at 8:04 AM Tierney, Luke wrote: > > R-devel has been switched to use reference counting by default with > r77508. Building with -DSWITCH_TO_NAMED go

Re: [Rd] Patch idea: an environment variable for setting the user ID

2019-11-22 Thread Henrik Bengtsson
Another thing to consider if one wants to anonymize the build is the UID/GID of the files in the tarball. So there might be a need for a R_BUILD_UID and R_BUILD_GID, e.g. by setting those to 32767 ("nobody"). /Henrik On Fri, Jan 25, 2019 at 9:25 AM Will L wrote: > > Thanks, Kurt. > > I think I

Re: [Rd] Suggestion: Make _R_CHECK_LENGTH_1_LOGIC2_=warn the default for R 3.6.2

2019-11-18 Thread Henrik Bengtsson
On Mon, Nov 18, 2019 at 6:55 AM Tomas Kalibera wrote: > > On 11/18/19 3:44 PM, Henrik Bengtsson wrote: > > .On Mon, Nov 18, 2019 at 12:35 AM Martin Maechler > > wrote: > >>>>>>> Henrik Bengtsson > >>>>>>> on Sun, 17 Nov 20

Re: [Rd] Suggestion: Make _R_CHECK_LENGTH_1_LOGIC2_=warn the default for R 3.6.2

2019-11-18 Thread Henrik Bengtsson
.On Mon, Nov 18, 2019 at 12:35 AM Martin Maechler wrote: > > >>>>> Henrik Bengtsson > >>>>> on Sun, 17 Nov 2019 20:42:32 -0800 writes: > > > Hi, > > > I'm not sure where we are in getting CRAN packages getting their >

[Rd] Suggestion: Make _R_CHECK_LENGTH_1_LOGIC2_=warn the default for R 3.6.2

2019-11-17 Thread Henrik Bengtsson
Hi, I'm not sure where we are in getting CRAN packages getting their _R_CHECK_LENGTH_1_LOGIC2_=true bugs fixed (*), but maybe it'd help to make _R_CHECK_LENGTH_1_LOGIC2_=warn the new default in the upcoming R 3.6.2? Warnings of type: $ R --vanilla > Sys.setenv("_R_CHECK_LENGTH_1_LOGIC2_" = "warn"

[Rd] BUG?: A copy of base::`+` (primitive) is not a clone but a "pointer"

2019-11-17 Thread Henrik Bengtsson
$ R --vanilla R version 3.6.1 (2019-07-05) -- "Action of the Toes" Copyright (C) 2019 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit) ... > str(base::`+`) function (e1, e2) > plus <- structure(base::`+`, class = "plus") > str(plus) function (e1, e2) - attr(*, "c

Re: [Rd] _R_CHECK_LENGTH_1_LOGIC2_ setting and Rstudio ..

2019-11-15 Thread Henrik Bengtsson
Yes, I ran into this too. I think they fixed it for RStudio 1.3 (https://github.com/rstudio/rstudio/pull/5457/files). My workaround is to enable these checks conditionally on not running R in the RStudio Console (it works in the RStudio Terminal). To test for the RStudio Console, you need to turn

  1   2   3   4   5   6   7   8   9   10   >