Re: [R-pkg-devel] callr and CRAN policy on the max number of cores

2024-05-22 Thread Henrik Bengtsson
Two parallel processes are okay, so you can use two callr background processes ("children"), as long as you don't do heavy computations on the main R process ("parent"). This is commonly done in many R packages, e.g. library(parallel) cl <- makeCluster(2) y <- parLapply(cl = cl, X = 1:10, fun =

Re: [R-pkg-devel] Fast Matrix Serialization in R?

2024-05-09 Thread Henrik Bengtsson
On Thu, May 9, 2024 at 3:46 PM Simon Urbanek wrote: > > > > > On 9/05/2024, at 11:58 PM, Vladimir Dergachev > > wrote: > > > > > > > > On Thu, 9 May 2024, Sameh Abdulah wrote: > > > >> Hi, > >> > >> I need to serialize and save a 20K x 20K matrix as a binary file. This > >> process is

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 >

Re: [R-pkg-devel] puzzling removal of 'dotwhisker' from CRAN

2024-04-18 Thread Henrik Bengtsson
On Thu, Apr 18, 2024 at 6:41 AM Uwe Ligges wrote: > > On 18.04.2024 15:35, Ben Bolker wrote: > > Yes, but ffbase was archived a long time ago (2022-04-04) and CRAN > > has apparently just caught up to checking. What's a little frustrating > > (to me) is that the dependence of prediction on

Re: [Bioc-devel] Important Bioconductor Release Deadlines

2024-04-08 Thread Henrik Bengtsson
> Henrik, if Bioconductor releases weren’t tied to R releases, how could > Bioconductor test them? I guess like CRAN where as long as a package says it > depends on R >= 2.0 then you’re free to try installing on 2.0 even though the > combination has never been tested? Maybe I worry too much

Re: [Bioc-devel] Important Bioconductor Release Deadlines

2024-04-08 Thread Henrik Bengtsson
C clusters, that they have no access to > the latest R versions. So sometimes even for demonstration purposes, we had > to install the package from the GitHub source, rather than from BiocManager. > > Cheers, > Anatoly > > On Fri, Apr 5, 2024 at 11:57 AM Henrik Bengtsson &g

Re: [Bioc-devel] Important Bioconductor Release Deadlines

2024-04-04 Thread Henrik Bengtsson
Hello, these days, it's quite straight forward to have multiple versions of R installed in parallel without them conflicting with each other. I know it works out of the box on MS Windows (just install all versions you'd like), and I know there are various tools to achieve the same on macOS. I'm

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

Re: [R-pkg-devel] Unusually long execution time for R.utils::gzip on r-devel-windows

2024-02-17 Thread Henrik Bengtsson
RtmpURWeVC" [9] "15.02.2024 04:00 RtmpUrwhHU" [ reached getOption("max.print") -- omitted 17165 entries ] Time difference of 18.67841 secs So, yeah, wow! I'll look into fixing this, probably by removing this fallback approach, which is very rarely n

Re: [R-pkg-devel] Unusually long execution time for R.utils::gzip on r-devel-windows

2024-02-16 Thread Henrik Bengtsson
Author of R.utils here. I happen to investigate this too right now, because of extremely slow win-builder performance of R.rsp checks, which in turn depends on R.utils. It's not obvious to me why this happens on win-builder. I've noticed slower and slower win-builder/cran-incoming checks over the

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

Re: [R-pkg-devel] new maintainer for CRAN package XML

2024-01-25 Thread Henrik Bengtsson
Some thoughts for what the next steps could be: I could be wrong, but I doubt that there's someone out there that wants to pick up 'XML' and start developing it beyond keeping the lights on. I also think the community agrees that 'xml2' is the recommended package to use for XML-related needs.

Re: [R-pkg-devel] Native pipe in package examples

2024-01-25 Thread Henrik Bengtsson
On Thu, Jan 25, 2024 at 9:23 AM Berwin A Turlach wrote: > > G'day Duncon, > > On Thu, 25 Jan 2024 11:27:50 -0500 > Duncan Murdoch wrote: > > > On 25/01/2024 11:18 a.m., Henrik Bengtsson wrote: > [...] > > I think you're right that syntax errors in help page

Re: [R-pkg-devel] Native pipe in package examples

2024-01-25 Thread Henrik Bengtsson
On Thu, Jan 25, 2024 at 8:27 AM Duncan Murdoch wrote: > > On 25/01/2024 11:18 a.m., Henrik Bengtsson wrote: > > On Thu, Jan 25, 2024 at 7:48 AM Duncan Murdoch > > wrote: > >> > >> On 25/01/2024 10:27 a.m., Josiah Parry wrote: > >>> Hey all, >

Re: [R-pkg-devel] Native pipe in package examples

2024-01-25 Thread Henrik Bengtsson
On Thu, Jan 25, 2024 at 7:48 AM Duncan Murdoch wrote: > > On 25/01/2024 10:27 a.m., Josiah Parry wrote: > > Hey all, > > > > I've encountered use of the native pipe operator in the examples for > > 'httr2' e.g. > > > > request("http://example.com;) |> req_dry_run() > > > > > > Since r-oldrel

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 <- tools::st

[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

Re: [R-pkg-devel] Wrong mailing list: Could the 100 byte path length limit be lifted?

2023-12-13 Thread Henrik Bengtsson
On Wed, Dec 13, 2023 at 8:06 AM McGrath, Justin M wrote: > > On Windows, packages will be in "C:\Users\[User > Name]\Documents\R\win-library\[R version]\[Package Name]". In R (>= 4.2.0), the default R_LIBS_USER path has moved to under LOCALAPPDATA, e.g. "C:\Users\[User

Re: [R-pkg-devel] Canonical way to Rprintf R_xlen_t

2023-11-29 Thread Henrik Bengtsson
On Tue, Nov 28, 2023 at 1:21 PM Tomas Kalibera wrote: > > > On 11/28/23 21:50, Henrik Bengtsson wrote: > > Daniel, I get those compiler warnings for '%td" MS Windows. It works > > fine on Linux. > > Please let me clarify. %td works in R on Windows in

Re: [R-pkg-devel] Canonical way to Rprintf R_xlen_t

2023-11-28 Thread Henrik Bengtsson
to debug these things. > > PS. I also tried using rhub, but it takes a long time and often results in a > PREPERROR. > > On Nov 28, 2023, at 3:58 PM, Henrik Bengtsson > wrote: > > CAUTION: The Sender of this email is not from within Dalhousie. > > "%td&q

Re: [R-pkg-devel] Canonical way to Rprintf R_xlen_t

2023-11-28 Thread Henrik Bengtsson
"%td" is not supported on all platforms/compilers. This is what I got when I added it to 'matrixStats'; * using log directory 'D:/a/matrixStats/matrixStats/check/matrixStats.Rcheck' * using R Under development (unstable) (2023-11-26 r85638 ucrt) * using platform: x86_64-w64-mingw32 * R was

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

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

2023-11-01 Thread Henrik Bengtsson
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: > > > >>>>&

[R-pkg-devel] CRAN archival: Does CRAN un-archive some packages automatically?

2023-11-01 Thread Henrik Bengtsson
I'm asking here to spare the CRAN Team a direct message, but also because the answer is of interest to others: Consider a package PkgA that was archived on CRAN, because it fails checks and errors that were not corrected in time. At the moment when package PkgA is archived, it will trigger

[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: [R-pkg-devel] Suppressing long-running vignette code in CRAN submission

2023-10-17 Thread Henrik Bengtsson
On Tue, Oct 17, 2023 at 12:45 PM John Fox wrote: > > Hello Dirk, > > Thank you for the additional information. > > As you suggest, what you did to distribute pre-built PDF vignettes is > quite similar to what R.rsp does, except that the latter also supports > pre-built HTML vignettes, which is

Re: [R-pkg-devel] Question regarding listing base and recommended packages programmatically and efficiently

2023-10-14 Thread Henrik Bengtsson
On Sat, Oct 14, 2023 at 5:25 AM Martin Maechler wrote: > > > Ivan Krylov > > on Thu, 12 Oct 2023 18:50:30 +0300 writes: > > > On Thu, 12 Oct 2023 11:32:24 -0400 > > Mikael Jagan wrote: > > >> > mk <- file.path(R.home("share"), "make", "vars.mk") > >> > pp <- sub("^.*=

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

Re: [R-pkg-devel] DESCRIPTION file Imports of base R packages

2023-10-03 Thread Henrik Bengtsson
On Tue, Oct 3, 2023 at 7:46 AM Jan Gorecki wrote: > > Hello, > > I noticed some packages define Imports in DESCRIPTION file listing base R > packages like methods, utils, etc. > > My question is that if it is necessary to list those* dependencies in > DESCRIPTION file, or is it enough to have

Re: [R-pkg-devel] Check package without suggests

2023-07-19 Thread Henrik Bengtsson
Hello, this is *not* a new behavior on CRAN, at least on (re-)submissions to CRAN. The package has to pass R CMD check --as-cran with all OK. If one of the Suggests:ed package is not installed, but one of your examples or package tests needed it, that would be detected by the check system. The

Re: [Bioc-devel] Urgent minor deployment of a release?

2023-06-19 Thread Henrik Bengtsson
On Mon, Jun 19, 2023 at 5:46 PM Vincent Carey wrote: > > Hi Adam, thanks for your note. > > Changes to release branch sources must be limited to bug fixes or doc > improvement. Any new features > must be introduced only in the devel branch. I know about this, but I wanted to find what the

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

Re: [R-pkg-devel] CRAN check fails on NEWS

2023-04-26 Thread Henrik Bengtsson
To reproduce this, you can use tools:::.news_reader_default(), e.g. > utils::download.file("https://raw.githubusercontent.com/gertvv/rsmaa/master/smaa/NEWS;, > "NEWS", quiet = TRUE) > news <- tools:::.news_reader_default("NEWS") Warning messages: 1: Cannot process chunk/lines: smaa 0.3-0 2:

Re: [Bioc-devel] missing packages on nebbiolo1

2023-04-11 Thread Henrik Bengtsson
Hello, those errors are because they forgot to declare those packages as dependencies; * eiR needs to add 'RSQLite' to Suggests: * ChemmineOB needs to add 'RUnit' to Suggests: /Henrik On Tue, Apr 11, 2023 at 1:26 PM Kevin Horan wrote: > > > The packages eiR and ChemmineOB are failing to build

Re: [Bioc-devel] Will package version 3.99.0 bump to 4.0.0?

2023-04-09 Thread Henrik Bengtsson
Sunday drive-by comment: I guess that means that our affxparser package which currently has version 1.71.1 in Bioc devel, will reach 1.99.0 in 13-14 years from now because of the automatic version bumps that are done twice a year. So, if we don't touch anything, it'll roll over to 2.0 around

Re: [Bioc-devel] Error building package

2023-04-06 Thread Henrik Bengtsson
Hello, add 'BiocStyle' to Suggests: in your DESCRIPTION file to fix this. For details, see /Henrik On Thu, Apr 6, 2023 at 8:12 AM ELENI ADAM wrote: > > Dear all, > > I am the creator of the hummingbird package ( >

Re: [Bioc-devel] Missing dependency errors on nebbiolo1 (Bioc 3.17)

2023-04-04 Thread Henrik Bengtsson
On Tue, Apr 4, 2023 at 2:44 AM Oleksii Nikolaienko wrote: > > Hi, > maybe because BiocStyle is not listed as a dependency or suggested package > in DESCRIPTION? > More info here: https://github.com/Bioconductor/BBS/issues/248 Yes, this is why. The package needs 'BiocStyle' to build the vignette,

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

[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

[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

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

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

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
nd > 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 - > even if the default is to add them. Again, the error is due to the > implementation of Sys.getenv() breaking in R-

[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: [Bioc-devel] PeacoQC Bioc version not in line with github repo

2022-12-15 Thread Henrik Bengtsson
> Indeed, although PeacoQC version on Bioc is higher (1.8) than in github repo (1.7.3), the latest commits have not been included. This is explained by Bioconductor bumping versions automatically when there's a new release cycle. So, in this case it went from something like 1.7.2 to 1.8.0 on the

Re: [R-pkg-devel] NOTEs - Problems with news in 'NEWS.md'

2022-12-12 Thread Henrik Bengtsson
I've got a check_news() function to test that a NEWS.md can be parsed as expected. See attached file (if that gets dropped in the interwebs, it's also at https://gist.github.com/HenrikBengtsson/2361371be4ae8681b3ee2eb361730990). Call it in the folder where the NEWS.md file is. My $.02 /Henrik

Re: [Bioc-devel] Packages failing Development build due to LaTex problem in .Rnw vignette

2022-12-09 Thread Henrik Bengtsson
sionInfo() records (and by default prints) the system time zone as > part of the locale information. > It was reported a couple of days ago in the R-devel mailing list by Henrik > Bengtsson, that time zones with underscores caused problems which seems to > be your case with the New_York t

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 > [1] "Ame

Re: [Bioc-devel] S4 Methods Documentation Convention Triggers Warnings

2022-12-01 Thread Henrik Bengtsson
> Anyways, that's hundreds of \items that I need to fix in a dozen of packages. > Not fun! A great opportunity to freshen up your 'sed' skills. (I think it's possible to use 'sed' here, but 100% sure) /Henrik On Thu, Dec 1, 2022 at 12:27 PM Hervé Pagès wrote: > > Itemizing brings semantics

[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. $

Re: [Bioc-devel] S4 Methods Documentation Convention Triggers Warnings

2022-11-30 Thread Henrik Bengtsson
> I think in \item{}{bar} the is not wrapped, so runs off the margin > in the devel ‘Constructor’ section. Would a hack be to split up the \code{} in multiple ones, e.g. \item{ \code{SnowParam(workers = snowWorkers(), type=c("SOCK", "MPI"),} \code{tasks = 0L, stop.on.error =

Re: [Bioc-devel] S4 Methods Documentation Convention Triggers Warnings

2022-11-27 Thread Henrik Bengtsson
What about: \item{\code{show(x)}}{ Displays the first five and last five elements. } ? On Sat, Nov 26, 2022, 23:00 Dario Strbenac via Bioc-devel < bioc-devel@r-project.org> wrote: > Good day, > > For a long time, it has been a convention to document S4 methods in the > format: > >

Re: [R-pkg-devel] [UNCLASSIFIED] Remotes in description when submitting a package until a dependency is fixed

2022-11-16 Thread Henrik Bengtsson
Not sure if it's already been said, but note that we can only use 'Additional_repositories' for *optional* dependencies, which are listed under 'Suggests' (and less used 'Enhances'). We cannot use them for *hard* dependencies, which are listed under 'Depends' or 'Imports'. From the CRAN Policies

Re: [R-pkg-devel] Too many processes spawned on Windows and Debian, although only 2 cores should be used

2022-11-16 Thread Henrik Bengtsson
Hello. As already pointed out, the current R implementation treats any non-empty value on _R_CHECK_LIMIT_CORES_ different from "false" as a true value, e.g. "TRUE", "true", "T", "1", but also "donald duck". Using '--as-cran' sets _R_CHECK_LIMIT_CORES_="TRUE", if unset. If already set, it'll not

Re: [R-pkg-devel] Examples with CPU time is greater than elapsed time.

2022-11-05 Thread Henrik Bengtsson
I think it's because it suggests that the package uses more than 250% of CPU load on average, which suggests it runs in parallel with more than two parallel workers, which is the upper limit in the CRAN Policies (https://cran.r-project.org/web/packages/policies.html); "If running a package uses

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

2022-10-10 Thread Henrik Bengtsson
t 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 Oct 2022, at

[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: [Bioc-devel] Interpreting BiocCheck output

2022-10-07 Thread Henrik Bengtsson
I'm throwing in another 1 cent. I agree that utils::globalVariables() is risky; since it goes in the root of the package code, it applies to *all* functions in the package, which is a bit too broad of a stroke for my taste. The way I deal with false globals from non-standard evaluation (NSE), is

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

Re: [R-pkg-devel] NOTE checking for detritus in the temp directory on windows

2022-09-30 Thread Henrik Bengtsson
Hi. > * checking for detritus in the temp directory ... NOTE > Found the following files/directories: > 'Rscript306c1f1adf1' 'Rscript3fb41f1adf1' Whenever seeing detritus files with name Rscript like these, it's a strong suggestion that parallel workers on MS Windows are involved. More

Re: [R-pkg-devel] Help - Shiny app on CRAN

2022-09-28 Thread Henrik Bengtsson
Hi, it's not just you; the win-builder server is down for all of us (e.g. https://downforeveryoneorjustme.com/win-builder.r-project.org?proto=https). Uwe Ligges, who maintains this, mentioned (in another thread somewhere) that there were networking issues at his university that are being worked

Re: [R-pkg-devel] Help - Shiny app on CRAN

2022-09-26 Thread Henrik Bengtsson
Hello, are you aware of https://win-builder.r-project.org/? It'll allow you to validate that your package passes all the requirements before submitting it to CRAN. My $.02 /Henrik On Mon, Sep 26, 2022 at 11:23 AM Jahajeeah, Havisha wrote: > > Dear team, > > My second attempt at submitting the

Re: [R-pkg-devel] Package ‘wflo’ was removed from the CRAN repository.

2022-09-24 Thread Henrik Bengtsson
Hello. It looks like things to have changed since; $ R CMD check --as-cran wflo_1.6.tar.gz * using log directory ‘/tmp/wflo.Rcheck’ * using R version 4.2.1 (2022-06-23) * using platform: x86_64-pc-linux-gnu (64-bit) * using session charset: UTF-8 * using option ‘--as-cran’ * checking for file

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

Re: [R-pkg-devel] HTML5 errors in win-builder R-release check

2022-05-03 Thread Henrik Bengtsson
Looks like a mistake in R that was fixed in R-devel (rev 82308) less than a day ago, cf. https://github.com/wch/r-source/commit/60cc6ebd762d4199aa8e5addf08282e336138a4a /Henrik On Tue, May 3, 2022 at 10:54 AM J C Nash wrote: > > I've been asked to "fix" some NOTEs in two of my packages. > >

[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

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 >

[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

Re: [Bioc-devel] Use set.seed inside function

2021-11-29 Thread Henrik Bengtsson
The easiest is to use withr::with_seed(), e.g. > withr::with_seed(seed = 42L, randomcoloR::distinctColorPalette(6)) [1] "#A0E1BC" "#B8E363" "#D686BE" "#DEA97F" "#B15CD8" "#A2B9D5" > withr::with_seed(seed = 42L, randomcoloR::distinctColorPalette(6)) [1] "#A0E1BC" "#B8E363" "#D686BE" "#DEA97F"

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

[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

[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
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 check' with --as-cr

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

2021-11-02 Thread Henrik Bengtsson
ER=[${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, > >> they could then be entered

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: [Bioc-devel] Package name

2021-10-22 Thread Henrik Bengtsson
For CRAN packages it's easy. Packages on CRAN are eternal. They may be archived, but they are never removed, so in a sense they're always "currently on CRAN". Archived packages may still be installed, but only with some efforts of the user. Some packages go in an out of "archived" status depending

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: [Bioc-devel] Too many dependencies / MultiAssayExperiment + rtracklayer

2021-10-19 Thread Henrik Bengtsson
If you're willing to depend on R (>= 4.0.0), then tools::R_user_dir() can replace the 'rappdirs' package. /Henrik On Mon, Oct 18, 2021, 09:05 Shraddha Pai wrote: > Hi all, > Despite moving rarely-used packages to Suggests and eliminating some (e.g. > TCGAutils), the number of dependencies is

Re: [Bioc-devel] Strange "internal logical NA value has been modified" error

2021-10-12 Thread Henrik Bengtsson
In addition to checking with Valgrind, the ASan/UBsan and rchk platforms on R-Hub (https://builder.r-hub.io/) can probably also be useful; > rhub::check(platform = "linux-x86_64-rocker-gcc-san") > rhub::check(platform = "ubuntu-rchk") /Henrik On Tue, Oct 12, 2021 at 4:54 PM Martin Morgan

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

2021-09-23 Thread Henrik Bengtsson
if this 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 80946 &g

[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" >

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

2021-09-17 Thread Henrik Bengtsson
gt; > 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 > > # Back to the original! > >

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 > Adler &

[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],

Re: [Bioc-devel] git: lost write access to some repos + what is my BiocCredentials email address?

2021-08-19 Thread Henrik Bengtsson
> Dana Farber Cancer Institute > > > On Aug 19, 2021, at 8:08 AM, Henrik Bengtsson > > wrote: > > > > Hi, > > > > I seem to have "lost" write access to several Bioconductor git > > repositories that I had git push access for before; > &g

[Bioc-devel] git: lost write access to some repos + what is my BiocCredentials email address?

2021-08-19 Thread Henrik Bengtsson
Hi, I seem to have "lost" write access to several Bioconductor git repositories that I had git push access for before; $ ssh -T g...@git.bioconductor.org | grep -E "(affxparser|aroma.light|illuminaio|QDNAseq)$" X11 forwarding request failed on channel 0 R packages/QDNAseq R

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()

[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()=",

Re: [R-pkg-devel] find functions with missing Rd tags

2021-06-23 Thread Henrik Bengtsson
$ grep -L -F "\value{" man/*.Rd /Henrik On Wed, Jun 23, 2021 at 10:58 AM Alex Chubaty wrote: > > During a recent package submission process, a CRAN maintainer showed one of > their checks found missing \value{} documentation in some package Rd files, > and asked us to ensure all exported

Re: [Bioc-devel] Build error "failure: length > 1 in coercion to logical" not reproducible

2021-06-17 Thread Henrik Bengtsson
On Thu, Jun 17, 2021 at 2:32 AM wrote: > > Dear colleagues, > > It seems to me that, starting with the latest BioC devel branch (3.14), the > build systems have become more pedantic about logical vectors of length > 1 > in conditions. Two of the packages I am maintaining, 'kebabs' and 'procoil' >

[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: [R-pkg-devel] Old version of rtracklayer on a single check server

2021-05-18 Thread Henrik Bengtsson
in the post has the > wrong version of rtracklayer for R-devel. > > Martin Morgan > > On 5/18/21, 11:49 AM, "R-package-devel on behalf of Henrik Bengtsson" < > r-package-devel-boun...@r-project.org on behalf of > henrik.bengts...@gmail.com> wrote: > >

  1   2   3   4   5   6   7   8   9   10   >