[Rd] Interaction parameter for split()

2012-06-08 Thread R. Michael Weylandt
here and would be happy to submit a patch if the powers that be are interested. Best, Michael __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] large dataset - confused

2012-07-23 Thread R. Michael Weylandt
1) Move this off R-devel to R-help. 2) Read the IO manual here: http://cran.r-project.org/manuals.html 3) You probably want to look at the read.table() function's help page by typing ?read.table Michael On Mon, Jul 23, 2012 at 12:32 PM, walcotteric wrote: > I'm trying to load a d

Re: [Rd] questions on R CMD INSTALL et al

2012-07-24 Thread R. Michael Weylandt
know if the following is possible and if so how so:- > a) obtaining more verbose output from make (is this makefile related ? ) > a) exercising control over the compiler settings for the creation of the > library module (mgcv.so in the above case)

Re: [Rd] [BUG?] utils::prompt(name=f)

2012-07-30 Thread R. Michael Weylandt
Just for the record, I don't see that error with 2.15.0 or with R-Devel 60040-someodd. Both display > foo <- function(x) cat(x, "\n") > prompt(name = "foo") Created file named ‘foo.Rd’. Edit the file and move it to the appropriate directory. Best, Michael On S

[Rd] Don't dput() data frames?

2012-08-28 Thread R. Michael Weylandt
al(iris, iris2) Cheers, Michael __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] Don't dput() data frames?

2012-08-28 Thread R. Michael Weylandt
On Tue, Aug 28, 2012 at 1:00 PM, Simon Urbanek wrote: > > On Aug 28, 2012, at 1:51 PM, R. Michael Weylandt wrote: > >> /src/main/attrib.c contains this comment in row_names_gets(): >> >> /* This should not happen, but if a careless user dput()s a >>

Re: [Rd] R crashes when printing a named numeric vector of a specific class - Bug?

2012-09-11 Thread R. Michael Weylandt
ch an object will call print.bar(), which calls print(), > which calls print.bar()... In a few moments the recursion will have gone > so deep that some system limit about the stack size must be reached, and > R is killed. > > If you just want to print the object as a vector, you do not

[Rd] Small Extension to license()/licence()

2012-09-30 Thread R. Michael Weylandt
er so marginally easier to know package licenses. Given the existence of license forms like GPL >=2, I don't see a easy programmatic way of identifying what RShowDoc() can provide and what it can't, so I've left that out. Cheers, Michael --

[Rd] malloc error in tab-completion: OS X

2012-10-07 Thread R. Michael Weylandt
//r.research.att.com/), which are at r60887 currently. Is there anything else I should check with my setup? I don't see any advice on this particular issue in the R installation manual, but I easily could have overlooked it. Thanks, Michael __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] Retrieving data from aspx pages

2012-10-30 Thread R. Michael Weylandt
Hi Jose, I think this is more of an r-help question so I'm going to forward your question there: R-devel is really for the development of R itself, not development with R. Cheers, Michael On Mon, Oct 29, 2012 at 8:11 PM, jose ramon mazaira wrote: > Hi. I'm trying to write an a

Re: [Rd] [R] choose folder interactively

2012-11-28 Thread R. Michael Weylandt
" does exist on Windows, so you could switch to that OS, or > write your own equivalent for MacOS. Is this the sort of thing for which a patch to the Mac-specific code would be welcomed/of some interest by R-Core or are their good reasons this doesn't already exist? Michael

Re: [Rd] [R] error in plot(table(c('a','a')))

2012-11-28 Thread R. Michael Weylandt
Should I file an issue for this in the bug tracker? Slighly rearranged discussion with reproducible example follows on below. > Em 26-11-2012 21:39, R. Michael Weylandt escreveu: >> >> On Mon, Nov 26, 2012 at 2:41 PM, Ludo Pagie wrote: >>> tbl.char1 <- table(c('a

Re: [Rd] It's a BUG or a Feature? Generating seq break comparing operators

2013-02-07 Thread R. Michael Weylandt
R FAQ 7.31 Cheers, MW On Thu, Feb 7, 2013 at 10:05 AM, Davide Rambaldi wrote: > Hello everybody: > > I get a strange behavior with seq, take a look at this: > >> msd <- seq(0.05,0.3, 0.01) >> msd[13] > [1] 0.17 >> class(msd) > [1] "numeric" >> class(msd[13]) > [1] "numeric" >> typeof(msd[13]) >

Re: [Rd] Viewing Compelete Decision Tree in R - R.2.15.2 - Wndows7 32bit

2013-03-14 Thread R. Michael Weylandt
Not an R-devel question. Wait for a response for your cross post to R-help. MW On Thu, Mar 14, 2013 at 9:51 AM, Manoj G wrote: > I tried drawing some decision trees. Since the number of levels are more in > the tree, the plot result for the decision tree is not clear and > conjusted. If i sav

[Rd] Typo-let in NEWS.Rd

2013-03-20 Thread R. Michael Weylandt
Applicable against current trunk and (I believe) R-3.0.0 branch. Michael Index: doc/NEWS.Rd === --- doc/NEWS.Rd (revision 62340) +++ doc/NEWS.Rd (working copy) @@ -183,7 +183,7 @@ through as bytes inputs invalid in the

Re: [Rd] Why does typeof() modify an object's "named" field?

2013-03-23 Thread R. Michael Weylandt
(1)] (len=5, tl=0) 1,2,3,4,5 > .Internal(typeof(z)) [1] "integer" > .Internal(inspect(z)) @7a8e9d8 13 INTSXP g0c3 [NAM(1)] (len=5, tl=0) 1,2,3,4,5 Michael [1] I'm not super certain about the fact it's the closure vs argument passing (or if the distinction even makes sense)

Re: [Rd] Catch SIGINT from user in backend C++ code

2013-05-02 Thread R. Michael Weylandt
ly. > > Is there a "R-standard" method of doing this? > I think R_CheckUserInterrupt() might be the right way to go but I haven't used it much, so not sure if it gives you recovery ability. Cheers, Michael > Thanks, > > Chris > > > -- > Dr Chris Jewell

Re: [Rd] diag() when input is a numeric scalar

2013-05-02 Thread R. Michael Weylandt
t said, I'm slightly confused by a bit of your message: are you conflating the rounding to integer issue with the different behavior for scalars issue (same as with sample())? Michael __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] Minimal build of R ...

2013-05-02 Thread R. Michael Weylandt
On Thu, May 2, 2013 at 5:12 PM, Jony Hudson wrote: > Hi, > > I'm trying to cross-compile R to javascript so that it can run in a > web-browser. Take as long as you need to stop laughing. So, as I was saying - > I want to try and get a build of R running in the browser. [If you're not > familia

Re: [Rd] Latex errors (build on windows)

2013-05-03 Thread R. Michael Weylandt
Can you post the offending package? On Fri, May 3, 2013 at 8:46 AM, Knut Krueger wrote: > Where can I found hepl about latex errors: > > the R CMD check tells me less, but: > * checking PDF version of manual ... WARNING > LaTeX errors when creating PDF version. > This typically indicates Rd probl

Re: [Rd] locking down R

2013-05-19 Thread R. Michael Weylandt
On Sun, May 19, 2013 at 7:16 PM, Ben Bolker wrote: > > Is anyone on this list aware of discussions about locking down/securing R? > > My colleagues and I are working with health statistics in an office > that disallows many useful tools (e.g. emacs, vim, perl, make) on the > grounds that they

Re: [Rd] Inconsistent results from .C()

2013-05-21 Thread R. Michael Weylandt
It might also help if you can point us to the C code to help debug. MW On Tue, May 21, 2013 at 10:53 AM, Robin Evans wrote: > I should add to this that I'm running on Scientific Linux 6. I later > noticed that the bug only seems to occur when I run the code from Rstudio, > and not if I use the

[Rd] diag() has a bug (PR#13702)

2009-05-14 Thread michael . m . spiegel
Full_Name: Michael Spiegel Version: 2.9.0 OS: linux Submission from: (NULL) (204.111.252.142) The diag() function appears to reject the first argument when it is a matrix, and nrow and ncol arguments are also provided. > foo <- matrix(c(1:4),2,2) > foo [,1] [,2] [1,]13

[Rd] c() poor error reporting (PR#13917)

2009-08-29 Thread michael . m . spiegel
Full_Name: Michael Spiegel Version: 2.9.1 OS: linux Submission from: (NULL) (137.54.6.192) The function c() gives a cryptic error message if an "empty" argument is accidentally passed to the function. The expression c(,,,) yields the error message "argument is missing, with no

[Rd] odd evaluation within correlation argument of glmmPQL

2009-10-20 Thread Bolker,Benjamin Michael
[I think I've seen this reported before but can't locate it any more. I believe this oddity (glitch? feature?) is behind a query that Jean-Baptiste Ferdy asked a year ago ] It appears that glmmPQL looks in the global workspace, n

[Rd] error in install.packages() (PR#14042)

2009-11-04 Thread michael . m . spiegel
Full_Name: Michael Spiegel Version: 2.10 OS: Windows Vista Submission from: (NULL) (76.104.24.156) The following error is produced when attempting to call install.packages. Here is the results of the traceback: > source('http://openmx.psyc.virginia.edu/getOpenMx.R') Error in f(r

[Rd] Linux installation

2008-05-08 Thread Michael Steinbeck-Reeves
a search on Google proved fruitless and I was forced to ask on r-help. I am now kicking myself, of course, but wouldn't it be a useful addition to the R installation FAQs, especially for those not acquainted with the C compiler output? Thanks, Michael -- Michael Stei

Re: [Rd] Linux installation

2008-05-09 Thread Michael Steinbeck-Reeves
On Thu, 2008-05-08 at 15:17 -0500, Marc Schwartz wrote: > on 05/08/2008 10:39 AM Michael Steinbeck-Reeves wrote: > > I have just installed R under Linux and had a tricky time finding out > > that I needed to install r-devel as it was not suggested by yum and > > does not appe

[Rd] build-aux missing in 2.9.0 packages (PR#13668)

2009-04-22 Thread michael . m . spiegel
Full_Name: Michael Spiegel Version: 2.9.0 OS: linux Submission from: (NULL) (128.143.137.189) I think something was changed in the handling of the build-aux directory when installing R packages. The directory is no longer copied into the installation directory. I believe it was not on the list

[Rd] Compile warning in unique.c

2005-08-29 Thread Harris, Michael (NIH/NCI) [E]
size Thanks, Michael [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

[Rd] bug with OutDec option and deferred_string altrep object

2018-10-08 Thread Michael Sannella via R-devel
cipen=0L, OutDec='.'. It would also be better if the data1 field was a well-formed pairlist; the current value of the data1 field causes R_inspect to segfault. I understand that you probably wouldn't want to change the deferred_string structure. An alternative fix would be to avoid this ca

[Rd] R_ext/Altrep.h should be more C++-friendly

2018-10-08 Thread Michael Sannella via R-devel
2. change the line R_new_altrep(R_altrep_class_t class, SEXP data1, SEXP data2); to R_new_altrep(R_altrep_class_t cls, SEXP data1, SEXP data2); since C++ doesn't like an argument named 'class' ~~ Michael Sannella [[alternative HTML version deleted]] _

[Rd] v3 serialization of compact_intseq altrep should write modified data

2018-10-22 Thread Michael Sannella via R-devel
) > x [1] 1 2 3 4 5 6 7 8 9 10 > I would have expected the modified vector data to be serialized to the file, and be restored when it is loaded. ~~ Michael Sannella [[alternative HTML version deleted]] __ R-devel@r-project

[Rd] error unserializing ascii format (v2 or v3)

2018-11-07 Thread Michael Sannella via R-devel
in earlier versions of R on Windows, and the same error happens in every version from R-2.15.3 (the earliest I have) on up. ~~ Michael Sannella [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mail

[Rd] STRING_IS_SORTED claims as.character(1:100) is sorted

2018-11-15 Thread Michael Sannella via R-devel
;,"2",..."10",... is not sorted. I suspect that the problem is that the Is_sorted method for deferred_string is just calling the Is_sorted method for the source object 1:100 (which _is_ a sorted integer vector). It should probably just return NA for any source object. ~~ Micha

Re: [Rd] setClass accepts slot-mismatch between slots and prototype arguments

2019-01-10 Thread Michael Lawrence via R-devel
2000's, I think, it became necessary for the extends classes to be defined, so it may be safe to add this constraint. I'll commit a fix soon. While fixing, I found that the type consistency check for slots shared with superclasses was completely broken ever since it was written in 2002.

Re: [Rd] selectMethod() can fail to find methods in situations of multiple dispatch

2019-03-19 Thread Michael Lawrence via R-devel
This is due to the intentional truncation of ANY suffixes from method signatures. I've hacked selectMethod() to be robust to that and will commit soon. Thanks for the report. Michael On Thu, Mar 14, 2019 at 9:32 AM Pages, Herve wrote: > Here is an example: > > setGeneric("

Re: [Rd] selectMethod() can fail to find methods in situations of multiple dispatch

2019-03-21 Thread Michael Lawrence via R-devel
If we started over, I'd try to avoid this sort of complexity, but "ANY" truncation has been happening since at least 2003. > matchSignature(c("numeric", "ANY"), foo) x "numeric" So I'm not sure we want to mess with it. Michael On Th

Re: [Rd] selectMethod() can fail to find methods in situations of multiple dispatch

2019-03-21 Thread Michael Lawrence via R-devel
be put on the roadmap. The alias instability and the fact that the user > has no way to know if s/he should do ?`foo,numeric-method` or > ?`foo,numeric,ANY-method` to find the method has been a long-standing > problem. > > H. > On 3/21/19 21:29, Michael Lawrence wrote: > > I

Re: [Rd] [PATCH 1/2] readtable: add hook for type conversions per column

2019-03-26 Thread Michael Lawrence via R-devel
Please file a bug on bugzilla so we can discuss this further. On Tue, Mar 26, 2019 at 11:53 AM Kurt Van Dijck < dev.k...@vandijck-laurijssen.be> wrote: > Hello, > > I want to find out if this patch is ok or not, and if not, what should > change. > > Kind regards, > Kurt > > __

Re: [Rd] [RFC] readtable enhancement

2019-03-27 Thread Michael Lawrence via R-devel
nd I'm not convinced that coercion failures should fallback gracefully to the default. Feature requests fall under a "bug" in bugzilla terminology, so please submit this there. I think I've made you an account. Thanks, Michael On Wed, Mar 27, 2019 at 1:19 PM Kurt Van Dijck < dev.k

Re: [Rd] [RFC] readtable enhancement

2019-03-28 Thread Michael Lawrence via R-devel
confer the beneficial constraints mentioned above. We can continue the discussion at: https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17546 Michael On Thu, Mar 28, 2019 at 1:35 AM Kurt Van Dijck < dev.k...@vandijck-laurijssen.be> wrote: > On wo, 27 mrt 2019 22:55:06 -0700, G

Re: [Rd] topenv of emptyenv

2019-03-28 Thread Michael Lawrence via R-devel
And it is used profusely by the methods package. On Thu, Mar 28, 2019 at 4:53 AM Gábor Csárdi wrote: > On Thu, Mar 28, 2019 at 11:43 AM Martin Maechler > wrote: > [...] > > > > Indeed... and as I mentioned I had never actively noticed the > > use of topenv() at all... > > FWIW topenv() is used

Re: [Rd] Format printing inside a matrix

2019-07-07 Thread Michael Lawrence via R-devel
r and matrix classes. S4Vectors in Bioconductor facilitates this for vectors, but not for higher-order arrays. Michael On Sun, Jul 7, 2019 at 4:44 PM Abby Spurdle wrote: > > > I am not sure if there is an existing solution to this, but I want my S4 > > objects inside a list matr

Re: [Rd] Possible bug in `class<-` when a class-specific '[[.' method is defined

2019-07-15 Thread Michael Lawrence via R-devel
s<-` is calling `[[.MYCLASS` 9 times ? > > Is there a way to avoid `class<-` to call `[[.MYCLASS` ? > > > Thank you in advance for your help and suggestions. > > Gionata > > > > [[alternative HTML version deleted]] > > __ >

[Rd] inconsistent behaviour of c(...)

2019-07-19 Thread Michael Meyer via R-devel
Greetings, Running R 3.5.0 under Windows 7 typeof(c(1,"2")) yields "character" as expected. But in d.f <- data.frame(C=c(1,"2")) typeof(d.f$C) yields "integer". Is this a bug? Michael Meyer

Re: [Rd] Any plans for ALTREP lists (VECSXP)?

2019-07-23 Thread Michael Lawrence via R-devel
Hi Kylie, As an alternative in the short term, you could consider deriving from S4Vector's List class, implementing the getListElement() method to lazily create the objects. Michael On Tue, Jul 23, 2019 at 9:09 AM Bemis, Kylie wrote: > > Hello, > > I was wondering if there w

[Rd] behaviour and documentation of qr.solve

2019-08-14 Thread Michael Meyer via R-devel
mposition of t(A) and not of A to compute the minimizer x = argmin_u||Au-y|| which is itself of minimal norm. Or, maybe this is not at all what these functions are doing. But then, what is it and should this not be evident from the documentation? Sincerely, Michael Meyer __

Re: [Rd] Feature request: non-dropping regmatches/strextract

2019-08-29 Thread Michael Lawrence via R-devel
I'd be happy to entertain patches or at least more specific suggestions to improve strextract() and strcapture(). I hadn't exported strextract(), because I wasn't quite sure how it should behave. This feedback should be helpful. Thanks, Michael On Thu, Aug 29, 2019 at 2:20 PM C

Re: [Rd] Feature request: non-dropping regmatches/strextract

2019-08-29 Thread Michael Lawrence via R-devel
tch, empty string on empty capture). Then we could call the regexpr()-based function strextract(). What do you think? Michael On Thu, Aug 29, 2019 at 3:27 PM Cyclic Group Z_1 wrote: > > Thank you! I greatly appreciate your consideration, though of course it is up > to you. I think ma

Re: [Rd] Feature request: non-dropping regmatches/strextract

2019-09-02 Thread Michael Lawrence via R-devel
es. Also, that sounds > like a great design for strcapture with an atomic prototype. > > Best, > CG -- Michael Lawrence Scientist, Bioinformatics and Computational Biology Genentech, A Member of the Roche Group Office +1 (650) 225-7760 micha...@gene.com Join Genentec

Re: [Rd] Cryptic error message from namespaceExport

2019-09-06 Thread Michael Lawrence via R-devel
John Tukey > /// > > <https://www.inbo.be> > > [[alternative HTML version deleted]] > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/l

Re: [Rd] Should slot<-() alter its first argument?

2019-09-21 Thread Michael Lawrence via R-devel
gp=0x10,ATT] > .Internal(inspect(`@<-`(z2, "x", value="newest"))) # NAMED == 0, same address > as above @56544726ae60 25 S4SXP g0c0 [OBJ,S4,gp=0x10,ATT] So I guess we could make slot<-() a bit safer but unless we give up the optimizations or maybe inform the "gets"

Re: [Rd] Cryptic error message from namespaceExport

2019-09-21 Thread Michael Lawrence via R-devel
Thanks. The error message will now say: undefined exports: class inla Will check-in after running more tests. On Fri, Sep 6, 2019 at 10:19 AM Thierry Onkelinx wrote: > Dear Michael, > > my package has setOldClass("inla") and the NAMESPACE > contains exportClasses(inl

Re: [Rd] New matrix function

2019-10-11 Thread Michael Lawrence via R-devel
Thanks for this interesting suggestion, Morgan. While there is no strict criteria for base R inclusion, one criterion relevant in this case is that the usefulness of a feature be proven in the package space first. Michael On Fri, Oct 11, 2019 at 5:19 AM Morgan Morgan wrote: > On Fri, 11

Re: [Rd] S4SXP type vs S4 object bit?

2019-10-22 Thread Michael Lawrence via R-devel
ts that do not derive from another basic type. Michael On Tue, Oct 22, 2019 at 1:28 AM Travers Ching wrote: > > I'm trying to understand the R internals a bit better and reading over the > documentation. > > I see that there is a bit related to whether an object is S4 &g

Re: [Rd] R C api for 'inherits' S3 and S4 objects

2019-11-01 Thread Michael Lawrence via R-devel
t; SEXP vec = PROTECT(ScalarString(char_)); > SEXP call = PROTECT(lang3(sym_inherits, x, vec)); > bool ans = LOGICAL(eval(call, R_GlobalEnv))[0]==1; > UNPROTECT(2); > return ans; > } > > ______ > R-devel@r-project.org ma

Re: [Rd] Troubles using numeric in s4 class union

2019-11-27 Thread Michael Lawrence via R-devel
gt; > union I defied is somehow interfering with the "index" class union in > > Matrix, R/AllClass.R, line 809 > > > 3. Why should the class union I defined interfere with the inner workings > > of a separate package? > > There is no good reason ... >

Re: [Rd] How to get an object name from C?

2020-01-24 Thread Michael Lawrence via R-devel
> > > substitute(x1) > x1 > > > Best regards, > Daniel > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel -- Michael Lawrence Senior Scientist, Bioinformatics and Computational B

Re: [Rd] Possible Regression in setClassUnion between 3.5.0 and 3.6.0

2020-02-18 Thread Michael Lawrence via R-devel
> My sessionInfo() is : > > > > R version 3.6.2 (2019-12-12) > > Platform: x86_64-pc-linux-gnu (64-bit) > > Running under: Ubuntu 18.04.3 LTS > > > > Matrix products: default > > BLAS: /usr/local/lib/R/lib/libRblas.so > > LAPACK: /usr/local/lib/R/lib/lib

Re: [Rd] Possible Regression in setClassUnion between 3.5.0 and 3.6.0

2020-02-25 Thread Michael Lawrence via R-devel
This seems to work as expected (returning "hi!") in R-devel, but there have been so many destabilizing changes to methods that it would be tough to port this to release. Probably should just wait for 4.0. Michael On Tue, Feb 18, 2020 at 8:00 PM Michael Lawrence wrote: > > Thanks

Re: [Rd] Possible Regression in setClassUnion between 3.5.0 and 3.6.0

2020-02-25 Thread Michael Lawrence via R-devel
ing again or do you > foresee a lot of changes coming in the 4.* series? > > On Tue, Feb 25, 2020 at 3:39 PM Michael Lawrence via R-devel > wrote: >> >> This seems to work as expected (returning "hi!") in R-devel, but there >> have been so many destabilizin

Re: [Rd] order function called on a data.frame?

2020-05-18 Thread Michael Lawrence via R-devel
. Shouldn't that raise an error, or at least warning? > > > > Best Regards, > > Jan Gorecki > > > > __ > > R-devel@r-project.org mailing list > > https://stat.ethz.ch/mailman/listinfo/r-devel > > > > _

[Rd] possible minor bug in fisher.test

2011-04-20 Thread Fay, Michael (NIH/NIAID) [E]
es the correct p-value of 1 and no errors. There is an easy solution. In fisher.test replace x <- factor(x[OK]) y <- factor(y[OK]) with x <- as.factor(x[OK]) y <- as.factor(y[OK]) (similar to how it is done in mcnemar.test). Mike *****

[Rd] Does parallel::mclapply work under emulation (Rosetta 2) on Apple Silicon?

2021-01-15 Thread Michael O'Dell via R-devel
Setting aside the documented problems of running R natively on Apple's M1 machines (https://developer.r-project.org/Blog/public/2020/11/02/will-r-work-on-apple-silicon/index.html) and similarly the current lack of native versions of many eco-system components (e.g. the discussion here:https://

[Rd] Should seq.Date() return double storage?

2021-09-07 Thread Michael Chirico via R-devel
today <- Sys.Date() typeof(today) # [1] "double" typeof(seq(today, by=1, length.out=2)) # [1] "integer" Clearly minor as it doesn't seem to have come up before (e.g. coercion to numeric will happen automatically whenever fractional dates are needed); I only noticed because of a test using identica

[Rd] .onLoad, packageStartupMessage, and R CMD check

2021-11-04 Thread Michael Chirico via R-devel
I wrote a linter to stop users from using packageStartupMessage() in their .onLoad() hook because of the R CMD check warning it triggers: https://github.com/wch/r-source/blob/8b6625e39cd62424dc23399dade37f20fa8afa91/src/library/tools/R/QC.R#L5167 However, this received some pushback which I ultim

Re: [Rd] .onLoad, packageStartupMessage, and R CMD check

2021-11-05 Thread Michael Chirico via R-devel
some state initialization, which has to happen after some (ex-ante unknown) set of packages are loaded. It's important to do so whether or not the package is attached, so the proviso in .onLoad() indeed makes the most sense. Thanks! On Thu, Nov 4, 2021 at 1:02 PM Gabriel Becker wrote: > > H

[Rd] Shouldn't "Loading" be "Attaching" when referring to library() calls?

2023-01-09 Thread Michael Chirico via R-devel
require() and library() both emit this message immediately before running library(): "Loading required package: %s" https://github.com/r-devel/r-svn/blob/4198a2941b702d965bb2374c2b908f48c369f40a/src/library/base/R/library.R#L967-L968 https://github.com/r-devel/r-svn/blob/4198a2941b702d965bb2374c

[Rd] Line-terminal \ in character consants -- missing from ?Quotes ?

2023-02-11 Thread Michael Chirico via R-devel
I'm coming across some code that uses the fact the parser ignores a line-terminal '\', e.g. identical("\ ", "\n") # [1] TRUE x = "abc \ def" y = "abc \ndef" identical(x, y) # [1] TRUE However: identical("\\n", "\n") # [1] FALSE This appears to be undocumented behavior; the closest thing I see i

Re: [Rd] Line-terminal \ in character consants -- missing from ?Quotes ?

2023-02-12 Thread Michael Chirico via R-devel
/github.com/r-devel/r-svn/blob/f55b24945d56e824f124638c596b99887441354a/src/main/gram.y#L2978-L3008 ('\n' is in the list of valid items after '\') I don't see any special handling for '\r', so there may be a gap in the R parser? Or I just don't understand w

[Rd] FR: names= argument for load()

2023-02-28 Thread Michael Chirico via R-devel
x27;s a more general issue of static analysis). Michael Chirico __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

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

2023-03-01 Thread Michael Chirico via R-devel
Consider: x <- list(`a b` = 1) x$a (i.e., press the 'tab' key after typing 'x$a') The auto-complete mechanism will fill the buffer like so: x$a b This is not particularly helpful because this is now a syntax error. It seems to me there's a simple fix -- in utils:::specialCompletions(), we can

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

2023-03-01 Thread Michael Chirico via R-devel
Great suggestion! I've started a patch: https://bugs.r-project.org/show_bug.cgi?id=18479 On Wed, Mar 1, 2023 at 1:56 AM Ivan Krylov wrote: > > В Wed, 1 Mar 2023 01:36:02 -0800 > Michael Chirico via R-devel пишет: > > > +comps[non_syntactic] <- paste0("`",

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

2023-03-02 Thread Michael Chirico via R-devel
I personally wouldn't like using a string, and this comment makes me think it's against the r-core preference as well: https://bugs.r-project.org/show_bug.cgi?id=18429#c1 Thanks both for catching the sloppy mistake in vapply() :) Let's continue discussion on the bug/PR. On Thu, Mar 2, 2023 at 1

[Rd] Improving user-friendliness of S4 dispatch failure when mis-naming arguments?

2023-08-09 Thread Michael Chirico via R-devel
I fielded a debugging request from a non-expert user today. At root was running the following: dbGetQuery(connection = conn, query = query) The problem is that they've named the arguments incorrectly -- it should have been [1]: dbGetQuery(conn = conn, statement = query) The problem is that the

Re: [Rd] Improving user-friendliness of S4 dispatch failure when mis-naming arguments?

2023-08-10 Thread Michael Chirico via R-devel
I forwarded that along to the original reporter with positive feedback -- including the argument names is definitely a big help for cuing what exactly is missing. Would a patch to do something similar for S4 be useful? On Thu, Aug 10, 2023 at 6:46 AM Hadley Wickham wrote: > > Hi Michael,

Re: [Rd] Improving user-friendliness of S4 dispatch failure when mis-naming arguments?

2023-08-10 Thread Michael Chirico via R-devel
cents that I think it would be very useful and > beneficial to improve S4 to surface that information as well. > > More information about the way that the dispatch failed would be of great > help in situations like the one Michael pointed out. > > ~G > > On Thu, A

Re: [Rd] Improving user-friendliness of S4 dispatch failure when mis-naming arguments?

2023-08-11 Thread Michael Chirico via R-devel
re(x = "double", y = "double"), \(x, y, ...) x + y) BaseGeneric(X = 1, Y = 2) # Error: unable to find an inherited method for function ‘BaseGeneric’ for signature ‘x="missing", y="missing"’ On Fri, Aug 11, 2023 at 2:26 AM Martin Maechler wrote: > > >

[Rd] Unclear provenance of message from S4

2023-08-14 Thread Michael Chirico via R-devel
MRE to produce the message is the following: setClass("Foo") setOldClass("Bar") setAs("Bar", "Foo", \(x) x) # NOTE: arguments in definition for coerce changed from (x) to (from) In an interactive setting, that may be fine, but I first encountered this message in the install log of a package for w

[Rd] FR: valid_regex() to test string validity as a regular expression

2023-10-09 Thread Michael Chirico via R-devel
It will be useful to package authors trying to validate input which is supposed to be a valid regular expression. As near as I can tell, the only way we can do so now is to run any regex function and check for the warning and/or condition to bubble up: valid_regex <- function(str) { stopifnot(i

Re: [Rd] FR: valid_regex() to test string validity as a regular expression

2023-10-10 Thread Michael Chirico via R-devel
ng" before any regex is actually executed. At a bare minimum this is a good place to return a classed warning (say invalid_regex_warning) to allow finer control than tryCatch(condition=). On Mon, Oct 9, 2023, 11:30 PM Tomas Kalibera wrote: > > On 10/10/23 01:57, Michael Chirico

Re: [Rd] FR: valid_regex() to test string validity as a regular expression

2023-10-11 Thread Michael Chirico via R-devel
idation is hardly practical. [1] https://laurikari.net/tre/google-releases-the-re2-library/ [2] https://hackerboss.com/is-your-regex-matcher-up-to-snuff/ On Wed, Oct 11, 2023 at 4:02 PM Toby Hocking wrote: > > Hi Michael, it sounds like you don't want to use a CRAN package for > t

Re: [Rd] [Sender Not Verified] is(x,"ANY") is FALSE

2023-05-02 Thread Michael Lawrence (MICHAFLA) via R-devel
Hi, This does seem to be a bug in is(); I'll take a look. I'm curious about what stopped you from using setOldClass(), since that seems to be the most appropriate solution. Michael On Tue, May 2, 2023 at 2:59 PM Russell Almond wrote: > > I’m somewhat puzzled by the following

<    2   3   4   5   6   7