Re: [Rd] [R] Open a file which name contains a tilde

2019-06-06 Thread Ivan Krylov
On Wed, 5 Jun 2019 18:07:15 +0200 Frank Schwidom wrote: > +> path.expand("a ~ b") > [1] "a /home/user b" > How can I switch off any file crippling activity? It doesn't seem to be possible if readline is enabled and works correctly. Calls to path.expand [1] end up [2] in R_ExpandFileName [3],

[Rd] tempdir() containing spaces breaks installing source packages

2019-12-13 Thread Ivan Krylov
Hello everyone! Temp paths are used in system2() calls without shQuote() because they are assumed not to contain spaces. On Windows, GetShortPathName() is used to try to ensure that. Unfortunately, sometimes GetShortPathName() silently fails to return a 8.3 file path and gives a full path instead

[Rd] system2 doesn't quote stdin on unix, unlike stdout, stderr & input and on Windows

2019-12-15 Thread Ivan Krylov
Hi again! While investigating the bug report [*] I found out that on unix, system2 does not quote its `stdin` argument while preparing the command line to launch. It does shQuote the `stdout` and `stderr` arguments, and also the `f <- tmpfile()` variable (which is used if `input` argument is prov

Re: [Rd] source definition for R_NilValue/return from TYPEOF(R_NilValue)

2019-12-16 Thread Ivan Krylov
On Sun, 15 Dec 2019 10:47:11 + Dan Kortschak wrote: > I'd like to see the source definition of R_NilValue, but after > fair bit of searching I cannot find an obviously location for this. > > Would someone please point me in the right direction? As far as I understand, the assignment to R_Ni

Re: [Rd] pipe(): input to, and output from, a single process

2020-03-16 Thread Ivan Krylov
On Fri, 13 Mar 2020 20:26:43 +0300 Greg Minshall wrote: > my sense from pipe and looking at the sources (sys-unix.c) is that is > not possible. is that true? are there any thoughts of providing > such a facility? Pipes (including those created by popen(3), which R pipe() uses internally) are u

Re: [Rd] ASAN

2020-04-08 Thread Ivan Krylov
On Tue, 07 Apr 2020 12:20:11 -0500 "Therneau, Terry M., Ph.D. via R-devel" wrote: > It's not quite clear to me what to do next. A quick check: do you have anything in LD_PRELOAD environment variable? Third-party software like gtk3-nocsd may be using it for its own purposes, which breaks ASan. Wh

Re: [Rd] detect ->

2020-04-15 Thread Ivan Krylov
On Wed, 15 Apr 2020 10:41:41 +0300 Adrian Dușa wrote: > Now, if I could find a way to define "=>" as a standalone operator, > and convince the R parser to bypass that error, it would solve > everything. If this is not possible, I am back to detecting "->". Just to confirm, are you avoiding custo

Re: [Rd] How to find detritis rejected by "R CMD check" on Debian?

2020-04-17 Thread Ivan Krylov
This should probably have been addressed to R-pkg-devel, not Rd. On Fri, 17 Apr 2020 09:14:44 -0500 Spencer Graves wrote: > Found the following files/directories: >   ‘fdaMatlabPath.m’ This is not the "detritus in the temp directory"; the message is related to the previous line in the log: >>

Re: [Rd] R 4.0.1-4.0.2 built with Intel Composer 19.0-19.1.1, error in "make check" on CentOS 7.7

2020-06-25 Thread Ivan Krylov
On Wed, 24 Jun 2020 18:56:06 + Ryan Novosielski wrote: On my machine, getOption('expressions') is 5000 and the example from the test correctly stops with length(traceback()) == 2500. (And the simpler example of f <- function() f(); f() stops with length(traceback()) == 5000). > Traceback: <

Re: [Rd] Error in substring: invalid multibyte string

2020-06-27 Thread Ivan Krylov
On Fri, 26 Jun 2020 15:57:06 -0700 Toby Hocking wrote: >invalid multibyte string at 'gel-A<6b>iyoshi' >https://stat.ethz.ch/pipermail/r-devel/1999-November/author.html The server says that the text is UTF-8: curl -sI \ https://stat.ethz.ch/pipermail/r-devel/1999-November/author.html | \ grep

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

2020-12-04 Thread Ivan Krylov
On Fri, 4 Dec 2020 20:11:17 -0600 (CST) luke-tier...@uiowa.edu wrote: > We did try a number of variations; the code is in the R-syntax branch. > At the root of that branch are two .md files with some notes as of > around useR20. Thanks for the information! Can I make a suggestion? If the variati

Re: [Rd] From .Fortran to .Call?

2020-12-19 Thread Ivan Krylov
On Sat, 19 Dec 2020 17:04:59 + "Koenker, Roger W" wrote: > There are comments in various places, including R-extensions §5.4 > suggesting that .Fortran is (nearly) deprecated and hinting that use > of .Call is more efficient and now preferred for packages. My understanding of §5.4 and 5.5 is

Re: [Rd] On Windows, need external access to the BLAS, LAPACK and LINPACK linear algebra functions included in R

2020-12-20 Thread Ivan Krylov
Hello Andre Mikulec! On Mon, 21 Dec 2020 00:20:35 + Andre Mikulec wrote: > ComputerUser@COMPUTER MINGW64 /c/APPLICATIONS/r-source-R-4-0-branch > > checking for BSD networking... configure: error: BSD networking > functions are required > > What do I need to do next? MinGW64 seems to be not

[Rd] WRE still hints at the "styles" field in R_FortranMethodDef

2020-12-23 Thread Ivan Krylov
The field has been removed in R 3.4.0 after being deprecated in R 3.3.3. Indeed, the paragraph describing it has been commented out (lines 10144-10151 in R-exts.texi), but another paragraph above (lines 10101-10110) still mentions the field as if it exists. I would like to suggest some rewording al

[Rd] r79833 src/library/tools/R/Rd2HTML.R minor typo

2021-01-16 Thread Ivan Krylov
On line 105, "&\\hellip;" should probably be "…": Index: Rd2HTML.R === --- Rd2HTML.R (revision 79833) +++ Rd2HTML.R (working copy) @@ -102,7 +102,7 @@ ## http://htmlhelp.com/reference/html40/entities/symbols.html if(inEq

[Rd] R.sh and argument escaping

2021-03-16 Thread Ivan Krylov
Hello R-devel! The following sequence of commands results in an error message on a POSIX system: tab="`echo -ne "\t"`" LC_ALL=C Rscript -e " $tab 1" # ARGUMENT '~+~1' __ignored__ Tabs can sneak into the -e argument from indented multi-line arguments in shell scripts: Rscript -e ' foo()

Re: [Rd] Possible x11 window manager window aggregation under one icon?

2021-03-22 Thread Ivan Krylov
On Sat, 20 Mar 2021 11:51:41 -0500 Dirk Eddelbuettel wrote: > R plots however all have one each. Needless to say I may also have > more than one plot device open... Would anyone know how we can force > these to aggregate under just one? Grouping seems to be achieved by setting the window_group

Re: [Rd] Possible x11 window manager window aggregation under one icon?

2021-03-22 Thread Ivan Krylov
On Mon, 22 Mar 2021 15:42:04 -0400 Duncan Murdoch wrote: > I'd be happy to add something to rgl if you could point me to > an example On Mon, 22 Mar 2021 14:54:43 -0500 Dirk Eddelbuettel wrote: > Just like Duncan I see now WM_HINTS yet, so maybe by > just giving them we can improve? The surr

Re: [Rd] Possible x11 window manager window aggregation under one icon?

2021-03-23 Thread Ivan Krylov
On Mon, 22 Mar 2021 16:57:48 -0500 Dirk Eddelbuettel wrote: > Do you want to send a proper patch to bugzilla? Would be glad to, especially if we manage to solve that problem you uncovered while I was asleep. On Mon, 22 Mar 2021 22:23:47 -0500 Dirk Eddelbuettel wrote: > Close, close, close but

Re: [Rd] Possible x11 window manager window aggregation under one icon?

2021-03-23 Thread Ivan Krylov
В Tue, 23 Mar 2021 08:58:49 -0500 Dirk Eddelbuettel пишет: > I still ship /usr/share/icons/hicolor/48x48/apps/rlogo_icon.png which > is from the 2012 patch, and I vaguely recall the .desktop file being > unhappy without it. Re-creating a 48x48 from the svg may do. I think you could even link /us

Re: [Rd] Possible x11 window manager window aggregation under one icon?

2021-03-23 Thread Ivan Krylov
On Tue, 23 Mar 2021 11:41:39 -0400 Duncan Murdoch wrote: > It would probably be nice to have rgl windows and other R graphics > windows in the same group, but I don't see a way for rgl to know the > group_leader that R is using (and it's probably not worth adding this > to the API to be able to

Re: [Rd] [Solved] Possible x11 window manager window aggregation under one icon?

2021-04-14 Thread Ivan Krylov
On Fri, 26 Mar 2021 14:49:56 +0100 Martin Maechler wrote: > I concluded I liked the first [patch] because it would achieve > what's considered "uniformly better" in the sense that it makes > R graphics behave like "all other" desktop applications *and* it > would do so for all possible window m

Re: [Rd] R 4.0.1-4.0.5 built with Intel Composer 19.0-19.1.1, error in "make check" on CentOS 7.7-7.9

2021-04-15 Thread Ivan Krylov
Hello Ryan, Sorry for not responding right away -- it took me a while to remember what I meant back then :) On Fri, 9 Apr 2021 23:34:13 + Ryan Novosielski wrote: > Program received signal SIGSEGV, Segmentation fault. > bcEval.R (body=0x3eb7748, rho=0x3f72770, useCache=TRUE) > at /scratch/no

Re: [Rd] R 4.0.1-4.0.5 built with Intel Composer 19.0-19.1.1, error in "make check" on CentOS 7.7-7.9

2021-04-16 Thread Ivan Krylov
On Thu, 15 Apr 2021 22:46:56 + Ryan Novosielski wrote: > (gdb) print $_siginfo._sifields._sigfault > $1 = { > si_addr = 0x7f7fecf8, _addr_lsb = 0, > _addr_bnd = {_lower = 0x9215f829ff58, _upper = 0x7f7fecf8} > } > (gdb) print R_CStackDir * (R_CStackStart - (uintptr_t)&codebase)

Re: [Rd] R 4.0.1-4.0.5 built with Intel Composer 19.0-19.1.1, error in "make check" on CentOS 7.7-7.9

2021-04-16 Thread Ivan Krylov
On Fri, 16 Apr 2021 18:06:51 + Ryan Novosielski wrote: > Well it definitely somehow could have, since it did Wow! This is strange, but at least it should be easy to fix. Try editing the config.site file in the root of the R source directory and setting R_C_STACK_DIRECTION=down there. (Make s

Re: [Rd] R 4.0.1-4.0.5 built with Intel Composer 19.0-19.1.1, error in "make check" on CentOS 7.7-7.9

2021-04-17 Thread Ivan Krylov
On Fri, 16 Apr 2021 18:39:04 + Ryan Novosielski wrote: > I guess there’s probably some mode of m4 I could run against that and > see if there’s any indication? Here's a shell script that should be doing the same thing that R's .../configure does, but a bit more verbose:

Re: [Rd] R 4.0.1-4.0.5 built with Intel Composer 19.0-19.1.1, errors in "make check" on CentOS 7.7-7.9

2021-04-17 Thread Ivan Krylov
On Sat, 17 Apr 2021 00:13:42 + Ryan Novosielski wrote: > reg-tests-1d.Rout.fail: > https://rutgersconnect-my.sharepoint.com/:u:/g/personal/novosirj_oarc_rutgers_edu/EYK2JHWQ1-9Dvu6gK9lrkRIBkEyA4QqkeH7C4gmbAYyBBQ?e=lfGJL7 > reg-packages.Rout.fail: > https://rutgersconnect-my.sharepoint.com/:u:

Re: [Rd] R 4.0.1-4.0.5 built with Intel Composer 19.0-19.1.1, errors in "make check" on CentOS 7.7-7.9

2021-04-19 Thread Ivan Krylov
On Sat, 17 Apr 2021 19:21:12 + Ryan Novosielski wrote: > I tried actual Pastebin and it told me that the > reg-tests-1d.Rout.fail was offensive. https://paste.debian.net says > it’s too large. Let’s give that another whack; both are here: > http://www.rnovosielski.ftml.net/r-project/ This li

[Rd] \Sexpr[results=hide] produces \verb{ newlines }

2021-07-29 Thread Ivan Krylov
Hello R-devel! Here's an Rd file that produces a large empty area when converted to HTML: \name{repro} \title{title} \description{description} \details{ Hello \Sexpr[stage=build,results=hide]{ invisible(NULL) invisible(NULL) invisible(NULL) invisible(NULL) invisible(NULL)

[Rd] Rd2txt: frmt() overestimates width of multi-line arguments

2021-07-31 Thread Ivan Krylov
Hi! I wanted to use the second argument of \figure{}{} to provide a pseudo-graphic rendition of the image and noticed that it's not centered despite the intent to do so is visible in the code. I traced it to a line in the frmt() function. It seems to me that frmt() doesn't expect its input to con

Re: [Rd] \Sexpr[results=hide] produces \verb{ newlines }

2021-08-05 Thread Ivan Krylov
Hello Martin, On Sat, 31 Jul 2021 22:14:17 +0200 Martin Maechler wrote: > I have implemented a version of your patch in my local copy of > R-devel and tested your example, also with Rd2latex() .. > interestingly Rd2txt() does not produce the extra new lines > even without your patch. That's

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

2021-10-15 Thread Ivan Krylov
On Fri, 15 Oct 2021 16:44:28 +0200 Michał Bojanowski wrote: > AVAR=${APPDATA}/foo/bar > > Which is a documented way of referring to existing environment > variables. Now, with that in R I'm getting: > > Sys.getenv("APPDATA")# That works OK > [1] "C:\\Users\\mbojanowski\\AppData\\Roaming" >

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

2021-10-15 Thread Ivan Krylov
Sorry for the noise! I wasn't supposed to send my previous message. On Fri, 15 Oct 2021 16:44:28 +0200 Michał Bojanowski wrote: > AVAR=${APPDATA}/foo/bar > > Which is a documented way of referring to existing environment > variables. Now, with that in R I'm getting: > > Sys.getenv("APPDATA")

Re: [Rd] Using R to wrap NREL's SSC library

2021-11-09 Thread Ivan Krylov
Sorry, this discussion is better continued at https://stat.ethz.ch/mailman/listinfo/r-package-devel. On Tue, 09 Nov 2021 16:19:13 + Ezra Tucker wrote: > PKG_LIBS=-L/opt/SAM/2020.11.29/linux_64 There's no good answer, but search "Writing R Extensions" for "rpath" for potential ways of solvin

Re: [Rd] string concatenation operator (revisited)

2021-12-05 Thread Ivan Krylov
On Sat, 4 Dec 2021 21:26:05 -0500 Avi Gross via R-devel wrote: > In many languages, like PERL, this results in implicated conversion > to make "text1" the result. FWIW, Perl5 has a separate string concatenation operator (".") in order to avoid potential confusion with addition. So do Lua (".."),

Re: [Rd] build failure: 'hashtab' is not an exported object from 'namespace:utils'

2021-12-16 Thread Ivan Krylov
On Thu, 16 Dec 2021 10:13:11 +0100 Stephen Berman wrote: > Is this a known issue and is there a fix? For me, the fix was to remove the already-installed $SVNROOT/library/utils (which didn't yet contain hashtab) and re-run make, letting the R build process re-install it from scratch. -- Best re

Re: [Rd] hashtab address arg

2021-12-22 Thread Ivan Krylov
On Sat, 18 Dec 2021 11:50:54 +0100 Arnaud FELD wrote: > However, I'm a bit troubled about the "address" argument. What is it > intended for since (as far as I know) "address equality" is until now > something that isn't really let for the user to decide within R. Using the words from "Extending

[Rd] Backslashes, braces, \Sexpr and user macros

2022-03-29 Thread Ivan Krylov
Hello R-devel, I had been using an Rd trick that runs afoul of the changes in r81965[*]. After the change, there seems to be a problem with any user-defined macro that takes R code, forwards it to \Sexpr and gets passed a string literal containing '{': \newcommand{\RRd}{\Sexpr[stage=build,resul

Re: [Rd] R-devel Digest, Vol 229, Issue 21

2022-03-30 Thread Ivan Krylov
On Wed, 30 Mar 2022 17:45:15 + Georgi Boshnakov wrote: > I am surprised that the above macro ever worked as intended. I'm sorry, somehow I didn't pay enough attention when preparing that part of the e-mail. The actual macro uses tools::toRd(bibentry(...)). > I don't know if something was fi

Re: [Rd] Writing in R // R 4.2.0 on Windows doesn't work with Dasher

2022-05-15 Thread Ivan Krylov
On Sun, 15 May 2022 11:10:49 -0300 Paulo Barata wrote: > I noticed today that R 4.2.0 responds to the "Enter" character of > Dasher version 5.0.0 beta in "Direct Entry" mode. An "Enter" in > Dasher causes the R prompt to jump to the next line, as an "Enter" > should do. > > No other characters (

[Rd] HTML documentation check: 'condition must be plain text'

2022-06-20 Thread Ivan Krylov
Hi, Use of \Sexpr in an \if condition in R documentation results in a NOTE, but only during HTML documentation check, not any of the previous Rd checks: \if{\Sexpr{'TRUE'}}{The condition evaluates to true.} * checking HTML version of manual ... NOTE Encountered the following conversion/validat

Re: [Rd] patch about timezone name of China Standard Time on windows

2023-01-05 Thread Ivan Krylov
Hello Yu Gong! I'm not an R developer, but I hope I'll be able to help you with my advice. On Fri, 6 Jan 2023 04:24:43 + gong yu wrote: > Last week ,I report a issuse about timezone name about" China > Standard Time", R on windows will report to Asia/Taipei , but it > should be Asia/Shangh

Re: [Rd] rhub vs. CRAN fedora-*-devel, using armadillo & slapack

2023-01-10 Thread Ivan Krylov
On Tue, 10 Jan 2023 16:27:53 + RICHET Yann wrote: > In facts, 10 threads are asked by armadillo for some LinAlg, which > backs to two threads as warned. I think you're right about your tests de-facto using two threads, but it might be a good idea to _default_ to up to two threads in tests a

Re: [Rd] rhub vs. CRAN fedora-*-devel, using armadillo & slapack

2023-01-11 Thread Ivan Krylov
On Wed, 11 Jan 2023 13:09:25 -0500 Duncan Murdoch wrote: > I think Sebastian or my suggestion is easier than redoing all of your > tests. They are each one line changes. Yes, sorry about that. Definitely try a verbose reporter first instead of redoing the tests. I'll remember not to give this

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

2023-01-31 Thread Ivan Krylov
Can we use the "bytes" encoding for such environment variables invalid in the current locale? The following patch preserves CE_NATIVE for strings valid in the current UTF-8 or multibyte locale (or non-multibyte strings) but sets CE_BYTES for those that are invalid: Index: src/main/sysutils.c =

[Rd] R2HTML doesn't split paragraphs originating from \Sexpr[results=rd]

2023-02-05 Thread Ivan Krylov
Hello, Here's an example that renders correctly using Rd2txt / Rd2latex / R CMD Rd2pdf, but has problems under Rd2HTML: \name{foo} \title{foo} \section{foo}{ This should be on a separate paragraph This should be on a separate paragraph This should be on a separate paragraph \Sexpr[stag

Re: [Rd] scan(..., skip=1e11): infinite loop; cannot interrupt

2023-02-11 Thread Ivan Krylov
On Fri, 10 Feb 2023 23:38:55 -0600 Spencer Graves wrote: > I have a 4.54 GB file that I'm trying to read in chunks using > "scan(..., skip=__)". It works as expected for small values of > "skip" but goes into an infinite loop for "skip=1e11" and similar > large values of skip: I cannot even

Re: [Rd] Question on non-blocking socket

2023-02-15 Thread Ivan Krylov
В Wed, 15 Feb 2023 01:24:26 +0100 Ben Engbers пишет: > where I can find R documentation on proper use of non-blocking > sockets and on the proper use of the socketSelect function? A useful guide to the Berkeley sockets API can be found at . You'll have to translate

[Rd] Robustifying R_CleanTempDir a bit more

2023-02-16 Thread Ivan Krylov
Hello, This is probably a very minor point, but R_CleanTempDir may still have a shell injection in it. I couldn't find a way to shoot the user in the foot in a significant way (by, say, accidentally removing ~), thanks to R disallowing spaces in the path, but if Sys_TempDir somehow acquires a valu

Re: [Rd] Robustifying R_CleanTempDir a bit more

2023-02-16 Thread Ivan Krylov
Thanks for the quick reply! On Thu, 16 Feb 2023 15:43:40 +0100 Tomas Kalibera wrote: > Please see 83851 from earlier today which does a bit more of > robustification, and if you find any problem in it, please let me > know. 83851 is an improvement, but it does let single quotes through, unfort

Re: [Rd] R: determine if `suppressMessages()` has been invoked

2023-02-19 Thread Ivan Krylov
On Sun, 19 Feb 2023 15:37:33 +0100 (CET) Nino Hardt wrote: > I would like to create a function that detects if suppressMessages > has been invoked upon running that same function. Would you mind letting us know why? Just curious. Normally, I would just use message() for everything and let the u

Re: [Rd] R: determine if `suppressMessages()` has been invoked

2023-02-19 Thread Ivan Krylov
On Sun, 19 Feb 2023 18:45:55 +0100 (CET) Nino Hardt wrote: > When using C or C++ via Rinside or within a package, those functions > do not listen to suppressMessages, e.g. `Rprintf` keeps printing to > the console. True, Rprintf is really convenient, but it doesn't raise any conditions and just

Re: [Rd] Possible NA Propagation Failure in RISC-V64 CPU?

2023-02-24 Thread Ivan Krylov
On Thu, 23 Feb 2023 15:39:08 -0800 Jane He wrote: > In short, according to my understanding of R's convention, any > calculation involving NA but no NaN should result in NA (called NA > propagation), and any calculation involving NaN but no NA should > result in NaN. Calculations involving both N

Re: [Rd] tab-complete for non-syntactic names could attempt backtick-wrapping

2023-03-01 Thread Ivan Krylov
В Wed, 1 Mar 2023 01:36:02 -0800 Michael Chirico via R-devel пишет: > +comps[non_syntactic] <- paste0("`", comps[non_syntactic], "`") There are a few more corner cases. For example, comps could contain backticks (which should be escaped with backslashes) and backslashes (which should also be esc

Re: [Rd] tab-complete for non-syntactic names could attempt backtick-wrapping

2023-03-02 Thread Ivan Krylov
There turn out to be a few more things to fix. One problem is easy to solve: vapply() needs a third argument specifying the type of the return value. (Can we have unit tests for tab completion?) The other problem is harder: `comps` defaults to an empty string, and you can't have a symbol consisti

Re: [Rd] `dendrapply` Enhancements

2023-03-02 Thread Ivan Krylov
Dear Aidan Lakshman, To answer your implicit question, VECTOR_ELT() unclasses the nodes because it doesn't go through the stats:::`[[.dendrogram` method, instead dereferencing the data pointer directly. Other *apply functions in base R create a call to the `[[` operator, letting the language disp

Re: [Rd] Multiple Assignment built into the R Interpreter?

2023-03-11 Thread Ivan Krylov
On Sat, 11 Mar 2023 11:11:06 -0500 Duncan Murdoch wrote: > That's clear, but your proposal violates a very basic property of the > language, i.e. that all statements are expressions and have a value. How about reframing this feature request from multiple assignment (which does go contrary to "

Re: [Rd] Making headers self-contained for static analysis

2023-03-16 Thread Ivan Krylov
Hello Lionel, Just letting you know off-list that the patch didn't make it through. Unfortunately, I don't remember the exact rules regarding attachments (does text/plain work?), but an external link is always an option, especially for large patches. -- Best regards, Ivan __

Re: [Rd] `dendrapply` Enhancements

2023-03-23 Thread Ivan Krylov
Hello Aidan, Sorry for dropping this for a while. В Thu, 2 Mar 2023 21:03:59 + "Lakshman, Aidan H" пишет: > //after > curnode = eval(lang3(R_Bracket2Symbol, parent->node, DEND_IND), env); lang3() always constructs a new language object. If you do end up using eval(), it may make sense to m

[Rd] removeSource() vs. function literals

2023-03-30 Thread Ivan Krylov
Dear R-devel, In a package of mine, I use removeSource on expression objects in order to make expressions that are semantically the same serialize to the same byte sequences: https://github.com/cran/depcache/blob/854d68a/R/fixup.R#L8-L34 Today I learned that expressions containing function defini

Re: [Rd] Breaking Change in Rcomplex Layout?

2023-04-04 Thread Ivan Krylov
On Tue, 4 Apr 2023 09:31:33 +0200 Tomas Kalibera wrote: > it also matters how Rust can handle anonymous nested structures, or > what is the right mapping of the involved C types to Rust It's worth mentioning that Rust's RFC 2102 [1] defines unnamed structs and unions for the purpose of C interop

Re: [Rd] removeSource() vs. function literals

2023-04-04 Thread Ivan Krylov
Thanks for the comments and sorry I didn't reply sooner! On Thu, 30 Mar 2023 12:38:24 -0400 Duncan Murdoch wrote: > You'd need to recurse through all expressions in the object. Some of > those expressions might be environments, so your changes could leak > out of the function you're working on.

Re: [Rd] removeSource() vs. function literals

2023-04-05 Thread Ivan Krylov
On Fri, 31 Mar 2023 08:49:53 +0200 Lionel Henry wrote: > If you can afford a dependency on rlang, `rlang::zap_srcref()` deals > with this. It's recursive over expression vectors, calls (including > calls to `function` and their hidden srcref arg), and function > objects. Thanks for the suggestio

[Rd] sum(), min(), max(), prod() vs. named arguments in ...

2023-04-14 Thread Ivan Krylov
Hello R-devel, As mentioned on Fosstodon [1] and discussed during RCOH [2], named arguments to sum(), min(), max() and prod() are currently processed the same way as the un-named ones. Additionally, when specifying the na.rm argument more than once, the last specified value is silently taken int

Re: [Rd] sum(), min(), max(), prod() vs. named arguments in ...

2023-04-17 Thread Ivan Krylov
В Sun, 16 Apr 2023 01:34:33 -0400 Mikael Jagan пишет: > Forbidding or warning against tagged arguments other than 'na.rm' > would be quite intrusive, since it is not uncommon to see > do.call(sum, ). Thank you for providing this counter-example! I did suspect this to be a non-starter, but didn't

Re: [Rd] Warnings created during R_eval or R_tryEval not shown before R ending or R error.

2023-04-26 Thread Ivan Krylov
В Sun, 23 Apr 2023 13:33:16 -0400 Laurent Gautier пишет: > When tracing what happens during an error I found that > verrorcall_dflt() in src/main/errors.c calls PrintWarnings(). That > function is not part of R's C-API though. I've tried reading the source code and came to a similar conclusion.

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

2023-05-02 Thread Ivan Krylov
В Sat, 29 Apr 2023 00:00:02 + Dario Strbenac via R-devel пишет: > Could save.image() be redesigned so that it promptly responds to > Ctrl+C? It prevents the command line from being used for a number of > hours if the contents of the workspace are large. This is ultimately caused by serialize

Re: [Rd] Heap access across multiple calls from R to C++

2023-05-23 Thread Ivan Krylov
On Wed, 24 May 2023 02:08:25 +0200 wrote: > initialize = function() { > > .C("make_native_obj", self$native_obj) > > }) > extern "C" void make_native_obj(double *obj) { > > auto native_obj = new NativeObjStruct(); > > memcpy(obj, &native_obj, sizeof(obj)); > > } > Is there a

Re: [Rd] Building R from source always fails on tools:::sysdata2LazyLoadDB

2023-05-30 Thread Ivan Krylov
On Tue, 30 May 2023 20:09:53 + Martin Morgan wrote: > ~/bin/R-devel/src/library/utils $ R_DEFAULT_PACKAGES=NULL > ../../../bin/R --vanilla > > tools:::sysdata2LazyLoadDB("/Users/ma38727/src/R-devel/src/library/utils/R/sysdata.rda","../../../library/utils/R") > > > zsh: killed R_DEFAUL

Re: [Rd] bug in utils:::format.person

2023-06-02 Thread Ivan Krylov
On Fri, 2 Jun 2023 16:55:59 +0200 Thierry Onkelinx via R-devel wrote: > I think I found a bug in utils::format.person when using style = "R" > with a vector of comments. The comment section is not parsed > properly. Good catch! This looks like another occasion of deparse() suddenly returning a m

Re: [Rd] readLines() fails on non-blocking connections when encoding="UTF-8" or encoding="ASCII"

2023-06-06 Thread Ivan Krylov
В Mon, 5 Jun 2023 21:34:37 -0700 Peter Meilstrup пишет: > socketSelect(list(incoming)) #TRUE > readLines(incoming, 1) # I get character(0) (incorrect) > readChar(incoming, 100) > # "again\nagain\nagain\n", so readChar saw what readLines() did not The difference turns out to be that readChar() u

Re: [Rd] codetools wrongly complains about lazy evaluation in S4 methods

2023-06-13 Thread Ivan Krylov
On Sat, 3 Jun 2023 11:50:59 -0400 Mikael Jagan wrote: > > setOldClass("qr") > > setMethod("qr.X", signature(qr = "qr"), function(qr, complete, > > ncol) NULL) > > The formals of the newly generic 'qr.X' are inherited from the > non-generic function in the base namespace. Notabl

Re: [Rd] New behavior when running script in package directory?

2023-06-21 Thread Ivan Krylov
On Wed, 21 Jun 2023 11:49:24 -0400 Dominick Samperi wrote: > 1. Why does Emacs/ESS behave differently depending on the > current working directory? > 2. Why is the signal package loaded automatically? There's a "package development mode" in ESS: https://github.com/emacs-ess/ESS/blob/master/lisp/

Re: [Rd] dir.exists returns FALSE on Symlink directory

2023-06-26 Thread Ivan Krylov
В Mon, 26 Jun 2023 10:26:07 -0400 Dipterix Wang пишет: > If I symlink a directory, is symlink considered as directory in R? It seems to work, at least on GNU/Linux: # (on this system, /var/lock is a symbolic link pointing to /run/lock/) system('ls -l /var/lock') # lrwxrwxrwx 1 root root <...> /

Re: [Rd] [R] Errors in "An introduction to R"

2023-07-10 Thread Ivan Krylov
Dear Jarkko, Thank you for spotting these problems and suggesting fixes for them! I am forwarding your e-mail to the R-devel mailing list (removing the R-help list, which is for different kind of R problems), together with a patch implementing your suggested changes. В Thu, 6 Jul 2023 10:12:16 +0

[Rd] _R_CHECK_DEPENDS_ONLY_ vs. packages in .Library [was: Check package without suggests]

2023-07-19 Thread Ivan Krylov
(Moving this one idea to R-devel) В Wed, 19 Jul 2023 09:21:46 +0200 Henrik Bengtsson пишет: > If you're on macOS, and have installed R the default way, it takes > more work to test on that platform. It works out of the box on Linux > and MS Windows. See the '[R-SIG-Mac] CRAN installer for macOS

Re: [Rd] tools::parseLatex() crashes on "\\verb{}"

2023-07-20 Thread Ivan Krylov
On Thu, 20 Jul 2023 21:41:44 +0200 Antoine Fabri wrote: > tools::parseLatex("\\verb{hello}") > # crashes the session Looking at the source [*], this seems to be happening because parseLatex expects the \verb macro to use the same character as the delimiter on both sides: tools::parseLatex('\\ve

Re: [Rd] tools::parseLatex() crashes on "\\verb{}"

2023-07-21 Thread Ivan Krylov
В Fri, 21 Jul 2023 15:14:09 +0200 Antoine Fabri пишет: > On a closer look it seems like roxygen2 introduces those, when using > markdown backtick quoting, if the quoted content is not syntactic. For > instance: > > #' `c(c(1)` > #' `c(c(1))` > > Will convert the first line to `\verb{c(c(1)}` an

Re: [Rd] random network disconnects

2023-08-05 Thread Ivan Krylov
В Mon, 31 Jul 2023 16:43:17 +0100 Patrick Burns пишет: > At work we are getting lots of issues with 'permission denied' or > 'network not found' and so forth when reading and writing between our > machines and a file server. This happens randomly so the following > function solves the problem

[Rd] HTML documentation check works best with Tidy >= 5.0.0

2023-08-05 Thread Ivan Krylov
Hello R-devel, Old versions of HTML Tidy report false positive NOTEs for the HTML verison of the manual where Tidy encounters HTML5 features it is not ready for. Conveniently, both HTML5 support and release version numbers officially appeared in HTML Tidy version 5.0.0 [*]. For example, the last

Re: [Rd] HTML documentation check works best with Tidy >= 5.0.0

2023-08-06 Thread Ivan Krylov
В Sun, 6 Aug 2023 12:18:09 +0200 Kurt Hornik пишет: > IIrc all Linux versions advertize themselves as something like > > HTML Tidy for Linux version 5.8.0 > > What about windows and macOS? I've checked the "modern" Windows binaries of HTML Tidy, and they say so too. Cannot check the macOS ve

Re: [Rd] A demonstrated shortcoming of the R package management system

2023-08-07 Thread Ivan Krylov
В Sun, 6 Aug 2023 16:05:03 -0500 Dirk Eddelbuettel пишет: > One possibility may be to add a new (versioned) field 'Breaks:'. > Matrix could then have added 'Breaks: SeuratObject (<= 4.1.3)' > preventing an installation of Matrix 1.6.0 when SeuratObject 4.1.3 > (or earlier) is present, but permitt

Re: [Rd] R-4.3 version list.files function could not work correctly in chinese

2023-08-11 Thread Ivan Krylov
Dear 叶月光, Thank you for your message, but please follow the posting guide in your future messages: https://www.r-project.org/posting-guide.html https://www.r-project.org/bugs.html I understand from your link that list.files() ends up skipping some Chinese filenames in R-4.3.1 (but not R-4.2.2) on

Re: [Rd] R-4.3 version list.files function could not work correctly in chinese

2023-08-12 Thread Ivan Krylov
Dear Yihui, Thanks a lot for your help! Unfortunately, I was not able to reproduce this. I've tried creating files with Chinese characters in their names and populating them with valid UTF-8 and valid non-UTF-8 text, but R seems to be able to list them all in my case. I'm running a US English ev

Re: [Rd] R-4.3 version list.files function could not work correctly in chinese

2023-08-13 Thread Ivan Krylov
Dear 叶月光, I believe you that there's a problem with list.files() and file names in Chinese. There is no need for additional proof. Unfortunately, it's impossible to fix the problem unless its source is found: https://www.chiark.greenend.org.uk/~sgtatham/bugs-cn.html Can you give me more examples

Re: [Rd] R-4.3 version list.files function could not work correctly in chinese

2023-08-13 Thread Ivan Krylov
Found it! Looks like a buffer length problem. This isn't limited to Chinese, just more likely to happen when a character takes three bytes to represent in UTF-8. (Any filename containing characters which take more than one byte to represent in UTF-8 may fail.) If a directory contains a file with a

Re: [Rd] R-4.3 version list.files function could not work correctly in chinese

2023-08-15 Thread Ivan Krylov
В Tue, 15 Aug 2023 08:38:11 +0200 Tomas Kalibera пишет: > As this was reported to be regression in 4.3, it is entirely possible > this change came with a regression (though a bit surprising we didn't > catch it earlier by testing), so it would be a great help if I could > have the example and

Re: [Rd] R-4.3 version list.files function could not work correctly in chinese

2023-08-16 Thread Ivan Krylov
On Wed, 16 Aug 2023 09:42:09 +0200 Tomas Kalibera wrote: > Fixed in R-devel (84960). Please let me know if you see any problem > with the fix. Thank you for implementing the fix! I gave 叶月光 the link to the GitHub Action build of the r84960 installer. I'm worried that 叶月光 was seeing FindNextFile

Re: [Rd] Security assessment

2023-08-30 Thread Ivan Krylov
В Tue, 29 Aug 2023 15:43:24 + "Jones, Jonathan D [US] (SP)" пишет: > Has any consideration or work been done to document or perform > vulnerability testing for the R packages? Is is specifically about third-party R packages or about R ecosystem as a whole, including R itself? This depends o

Re: [Rd] Updated `dendrapply`

2023-09-01 Thread Ivan Krylov
В Fri, 1 Sep 2023 09:17:57 + "Lakshman, Aidan H" пишет: > - Ivan previously mentioned issues with user specific `[[.dendrogram` > implementations, and it doesn't seem that you've fixed that. > This is correct. I discovered during the R project sprint that > `stats::dendrapply` does not respe

[Rd] On PRINTNAME() encoding, EncodeChar(), and being painted into a corner

2023-09-18 Thread Ivan Krylov
Hello R-devel, I have originally learned about this from the following GitHub issue: . In short, in various places of the R source code, symbol names are accessed using translateChar(), EncodeChar(), and CHAR(), and it might help to unify

Re: [Rd] proposal: 'dev.capabilities()' can also query Unicode capabilities of current graphics device

2023-09-23 Thread Ivan Krylov
On Wed, 20 Sep 2023 12:39:50 +0200 Martin Maechler wrote: > The problem is that some pdf *viewers*, > notably `evince` on Fedora Linux, for several years now, > do *not* show *some* of the UTF-8 glyphs because they do not use > the correct fonts One more problem that makes it nontrivial to use

[Rd] Crashes and other problems uncovered by static analysis

2023-09-26 Thread Ivan Krylov
Hello R-devel, I've been trying to see if static analysers could have caught PR18602. Surprisingly, the analysers I've tried don't seem to notice it, but they do uncover other problems. While most of these either stem from slightly too defensive programming ("condition is always true/false" warni

Re: [Rd] proposal: 'dev.capabilities()' can also query Unicode capabilities of current graphics device

2023-09-26 Thread Ivan Krylov
On Tue, 26 Sep 2023 12:39:57 +1300 Paul Murrell wrote: > Yes, you can set up your own font and TeX installations are a good > source of Type 1 fonts. Here is an example (paths obviously specific > to my [Ubuntu 20.04] OS and TeX installation) ... Many thanks for the explanation! Your example w

Re: [Rd] Minor bug with stats::isoreg

2023-09-27 Thread Ivan Krylov
В Wed, 27 Sep 2023 13:49:58 -0700 Travers Ching пишет: > Calling isoreg with an Inf value causes a segmentation fault, tested > on R 4.3.1 and R 4.2. A reproducible example is: `isoreg(c(0,Inf))` Indeed, the code in src/library/stats/src/isoreg.c contains the following loop: do { sl

Re: [Rd] [R-pkg-devel] Problem with "compacting" pdf files.

2023-10-02 Thread Ivan Krylov
Dear Rolf, (Moving this one to R-devel...) On Sun, 1 Oct 2023 21:01:13 + Rolf Turner wrote: > I *really* think that the instructions from CRAN could have been > clearer! Without your guidance I'd have been at a total loss. Since the CRAN e-mails quote the R CMD check messages verbatim, w

Re: [Rd] [External] On PRINTNAME() encoding, EncodeChar(), and being painted into a corner

2023-10-03 Thread Ivan Krylov
Dear Luke Tierney, Thank you for the reply and apologies for not getting back to you earlier. On Fri, 22 Sep 2023 16:14:58 -0500 (CDT) luke-tier...@uiowa.edu wrote: > I think it would be best to modify errorcall so errorcall_cpy is not > necessary. As things are now it is just too easy to forget

Re: [Rd] as(, "dgTMatrix")' is deprecated.

2023-10-03 Thread Ivan Krylov
On Tue, 3 Oct 2023 16:50:55 + "Koenker, Roger W" wrote: > I thought it might come from Rmosek, but mosek folks don’t think so. I downloaded the Rmosek source package using download.packages( 'Rmosek', '.', repos='https://download.mosek.com/R/10.1' ) ...and there are the deprecated calls

Re: [Rd] system()/system2() using short paths of commands on Windows?

2023-10-31 Thread Ivan Krylov
On Mon, 30 Oct 2023 15:36:50 -0500 Yihui Xie wrote: > I have read about "system() not using a shell on Windows" on the help > page many times before but never understood what it means technically. This means resolving the path to the executable, then calling CreateProcess() to launch that execut

[Rd] svd() of a 30000 by 30000 matrix segfaults: 32-bit length overflow in LAPACK?

2023-11-03 Thread Ivan Krylov
Dear Dr. Robert M Flight, dear R-developers, By an accident, I've noticed this problem reported on Mastodon [1]. On a computer with ≥32G of RAM, running the following code (which may take 5 CPU-hours and allocate 27G of RAM!) results in a segfault: n_val <- 3 tmp_matrix <- matrix(rnorm((n_va

  1   2   >