Re: [Rd] Recommend/clarify in ?utils::news that h2/h3 markdown hierarchy is preferable to h1/h2

2025-05-12 Thread Michael Chirico
Sounds good. Moving over to Bugzilla: https://bugs.r-project.org/attachment.cgi?id=3480&action=diff On Mon, May 12, 2025 at 10:29 AM Kurt Hornik wrote: > > >>>>> Michael Chirico writes: > > Thanks. Should be ok to change the wording (provided this can be done

[Rd] Why does format.default skip dispatch for list items?

2025-05-11 Thread Michael Chirico
This is the documented behavior since r35262 (2005), from ?format > If x is a list, the result is a character vector obtained by applying > format.default(x, ...) to each element of the list One consequence is that we can't add "nice" printing methods for list-of-object columns in data.frames:

[Rd] Recommend/clarify in ?utils::news that h2/h3 markdown hierarchy is preferable to h1/h2

2025-05-05 Thread Michael Chirico
The current wording in ?utils::news reads to me as implying we should use `#` and `##` for the respective version, category headings [1]: > File NEWS.md should contain the news in Markdown..., with the > primary heading level giving the version number... Where available, > secondary headings are t

Re: [Rd] R should add an API routine for safe use of memcpy(), memset() for use with 0-length SEXP

2025-04-24 Thread Michael Chirico
Kalibera wrote: > > > On 4/24/25 00:18, Michael Chirico wrote: > > In that case it seems like just erroring instead of returning invalid > > pointers is a much friendlier option. Why give developers an unpinned > > grenade to carry around? > > That would be too strict

Re: [Rd] R should add an API routine for safe use of memcpy(), memset() for use with 0-length SEXP

2025-04-23 Thread Michael Chirico
In that case it seems like just erroring instead of returning invalid pointers is a much friendlier option. Why give developers an unpinned grenade to carry around? On Wed, Apr 23, 2025 at 1:38 PM Tomas Kalibera wrote: > > On 4/23/25 19:03, Michael Chirico wrote: > > h/t Tim Taylor

Re: [Rd] R should add an API routine for safe use of memcpy(), memset() for use with 0-length SEXP

2025-04-23 Thread Michael Chirico
/RS.h#L62-L63 [4] https://github.com/r-devel/r-svn/blob/9e597ca8132e8b6298b0bedb39fa8deba5c819df/src/main/memory.c#L3582-L3587 Mike C On Wed, Apr 23, 2025 at 8:57 AM Michael Chirico wrote: > > From R 4.5.0 [1], all builds of R discourage use of INTEGER() [and > friends REAL()

[Rd] R should add an API routine for safe use of memcpy(), memset() for use with 0-length SEXP

2025-04-23 Thread Michael Chirico
>From R 4.5.0 [1], all builds of R discourage use of INTEGER() [and friends REAL(), ... and *_RO() equivalents] on length-0 SEXP [2]. Before R 4.5.0, this was the behavior under --enable-strict-barrier. That means the following can segfault under strict builds (e.g. -fsanitize=alignment and -O0):

Re: [Rd] Why does NextMethod() pick up duplicate arguments in '...' if given positionally at top level?

2025-03-25 Thread Michael Chirico
thod to > decide whether to follow the suggestion in 15654, and could maybe submit > a patch for that, too. > > Duncan Murdoch > > > On 2025-03-25 2:12 a.m., Michael Chirico wrote: > > Consider: > > > > foo <- function(x, y, ...) { > > UseMethod(&q

[Rd] Why does NextMethod() pick up duplicate arguments in '...' if given positionally at top level?

2025-03-24 Thread Michael Chirico
Consider: foo <- function(x, y, ...) { UseMethod("foo") } foo.default <- function(x, y = 0, ...) { cat(sprintf("%s: x=%s, y=%s\n", as.character(match.call()[[1L]]), x, y)) if (...length()) str(list(...)) } foo.C <- function(x, y = 3, ...) { cat(sprintf("%s: x=%s, y=%s\n", as.char

[Rd] More precise documentation of on.exit() [when leaving function vs. "context"]

2025-02-14 Thread Michael Chirico
The current documentation of ?on.exit reads [1] > `on.exit` records [`expr`] as needing to be executed when the current > function exits... This is almost always how it is used, however I don't see that as explaining this other common way to use on.exit(): local({ old = setwd(...) on.exit(s

[Rd] Suggestion to emphasize Rboolean is unrelated to LGLSXP in R-exts

2025-01-30 Thread Michael Chirico
is > \emph{not} related to the R logical type LGLSXP. This can conflict with other > software: for example it conflicts with the headers in IJG’s jpeg-9 (but not > earlier versions). It would also be nice if this mistake could be caught by the compiler, but that's another issue. Michael

Re: [Rd] Is it advisable/possible to default on Linux to an EDITOR that actually exists?

2024-12-20 Thread Michael Chirico
this. Mike C On Sat, Dec 14, 2024 at 4:02 AM Dirk Eddelbuettel wrote: > > > On 11 December 2024 at 15:00, Michael Chirico wrote: > | Thanks Simon, I didn't know that! That's definitely a compelling > | reason to leave the current default untouched and to eschew any > |

Re: [Rd] Is it advisable/possible to default on Linux to an EDITOR that actually exists?

2024-12-10 Thread Michael Chirico
d Where I come up short is knowing the platform-robust way to implement this -- nzchar(Sys.which(editor)) looks like it will work fine on Unix, but I don't know what to do about macGUI/Windows. Mike C On Wed, Dec 11, 2024 at 9:31 AM Simon Urbanek wrote: > > Michael, > > vi

Re: [Rd] Is it advisable/possible to default on Linux to an EDITOR that actually exists?

2024-12-10 Thread Michael Chirico
editor by default -- VSCode does the bulk of the work & I only install 'nano' to do things outside the "current" repo. In short, there are very many ways EDITOR can wind up un-set/incorrect. On Wed, Dec 11, 2024 at 12:46 AM Dirk Eddelbuettel wrote: > > > Michael, &g

[Rd] Is it advisable/possible to default on Linux to an EDITOR that actually exists?

2024-12-10 Thread Michael Chirico
It looks like R has defaulted to using 'vi' for file.edit() (via EDITOR since ~24 years ago[1][2]. These days I think it is much more common to write code from lightweight environments, e.g. Docker files which strip all unnecessary commands. On such machines, it is not safe to assume 'vi' is insta

Re: [Rd] numerical issue with t.test

2024-09-16 Thread Michael Dewey
Dear Toby I see no problem there. If you compute the mean and variance of err1 - err2 which is what the paired test is working on then that might help to see what is going on. Michael On 16/09/2024 15:47, Toby Hocking wrote: Hi! I expected that t.test should report a very large p-value

[Rd] Petition to set warnPartialMatch* options to TRUE during R CMD check by default

2024-04-22 Thread Michael Chirico
Hi all, What it says in the title. This is likely to cause a lot of CRAN packages to fail (I can try and quantify this if seen fit), but I think it's for the best. Packages should not (IMHO) be relying on partial matching in package code / tests. One might be more permissive for vignette/examples

Re: [Rd] [External] Re: Repeated library() of one package with different include.only= entries

2024-04-15 Thread Michael Chirico
fruit. On Mon, Apr 15, 2024 at 6:46 AM Martin Maechler wrote: > I think we should try to advance and hopefully finalize this > thread before we forget about it .. > > >>>>> Michael Chirico n Thu, 11 Apr 2024 09:10:11 -0700 writes: > > >> I would assume

Re: [Rd] [External] Re: Repeated library() of one package with different include.only= entries

2024-04-11 Thread Michael Chirico
I think your suggestion to just point to detach()+attachNamespace() is reasonable enough, the rare users that care about this are likely to be able to figure out the rest from there. On Thu, Apr 11, 2024 at 7:37 AM wrote: > On Thu, 11 Apr 2024, Duncan Murdoch wrote: > > &g

[Rd] Repeated library() of one package with different include.only= entries

2024-04-08 Thread Michael Chirico
Right now, attaching the same package with different include.only= has no effect: library(Matrix, include.only="fac2sparse") library(Matrix) ls("package:Matrix") # [1] "fac2sparse" ?library does not cover this case -- what is covered is the _loading_ behavior of repeated calls: > [library and re

[Rd] readChar() could read the whole file by default?

2024-01-26 Thread Michael Chirico
I am curious why readLines() has a default (n=-1L) to read the full file while readChar() has no default for nchars= (i.e., readChar(file) is an error). Is there a technical reason for this? I often[1] see code like paste(readLines(f), collapse="\n") which would be better served by readChar(), esp

Re: [Rd] c(NA, 0+1i) not the same as c(as.complex(NA), 0+1i)?

2023-11-06 Thread Michael Chirico
main/bind.c#L418-L425 And indeed! It's not "coercion" in the sense I just described... there's a branch for the 'x == NA_LOGICAL' case to _convert_ to NA_complex_. On Mon, Nov 6, 2023 at 3:08 AM Martin Maechler wrote: > >>>>> Michael Chirico >

[Rd] c(NA, 0+1i) not the same as c(as.complex(NA), 0+1i)?

2023-11-05 Thread Michael Chirico
This is another follow-up to the thread from September "Recent changes to as.complex(NA_real_)". A test in data.table was broken by the changes for NA coercion to complex; the breakage essentially comes from c(NA, 0+1i) # vs c(as.complex(NA), 0+1i) The former is the output we tested against; the

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

[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] [R-pkg-devel] Problem with "compacting" pdf files.

2023-10-02 Thread Michael Dewey
, why didn't you compress them then?". Thank you for your help on this. Michael On 02/10/2023 12:58, Ivan Krylov wrote: 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 ha

[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

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

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

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

[Rd] Forcing a PROTECT Bug to Occur

2023-04-29 Thread Michael Milton
I'm trying to learn about R's PROTECT system. To that end I've tried to create an example of C code that doesn't protect anything. I was hoping it would either segfault from trying to access deallocated memory, or maybe print out nonsense results because the unprotected memory got overwritten, but

Re: [Rd] Generalised piping into operators

2023-04-22 Thread Michael Milton
x27;t realise!): > 1 |> `+`(x=_, 2) [1] 3 On Sat, Apr 22, 2023 at 3:00 AM Duncan Murdoch wrote: > On 21/04/2023 12:16 p.m., Michael Milton wrote: > > I'm afraid I don't understand. I know that parsing `+`(1, 1) returns a > > result equivalent to `1 + 1`, bu

Re: [Rd] Generalised piping into operators

2023-04-21 Thread Michael Milton
I'm afraid I don't understand. I know that parsing `+`(1, 1) returns a result equivalent to `1 + 1`, but why does that impose a restriction on parsing the pipe operator? What is the downside of allowing arbitrary RHS functions? [[alternative HTML version deleted]]

Re: [Rd] Generalised piping into operators

2023-04-21 Thread Michael Milton
Thanks, this makes sense. Is there a similar precedence reasoning behind why operator functions (`+` etc) can't be piped into? On Fri, Apr 21, 2023 at 11:52 PM Duncan Murdoch wrote: > On 21/04/2023 4:35 a.m., Michael Milton wrote: > > I just checked out R-devel and noticed that

[Rd] Generalised piping into operators

2023-04-21 Thread Michael Milton
he function parse tree seems like it would work fine if this was allowed in a pipe. Cheers, Michael [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] Breaking Change in Rcomplex Layout?

2023-04-04 Thread Michael Milton
I don't think an auto-generated name (along the lines of u or u2) for the anonymous structs would be helpful here. You can see that bindgen is already generating a placeholder name ("__bindgen_anon_1"). A meaningful name might be nice instead, but I get the impression that isn't an option here sinc

Re: [Rd] Breaking Change in Rcomplex Layout?

2023-04-03 Thread Michael Milton
ing on the R version being used. Cheers On Tue, Apr 4, 2023 at 12:15 AM Tomas Kalibera wrote: > > On 4/3/23 15:50, Michael Milton wrote: > > Okay, but I'm afraid this will only mean something to Rust users. The > reason being that we encountered this issue in extendr:

Re: [Rd] Breaking Change in Rcomplex Layout?

2023-04-03 Thread Michael Milton
; > On 4/3/23 14:07, Michael Milton wrote: > > Hi all, > > > > There seems to have been a breaking change in the R trunk caused by a fix > > to bug 18430 <https://bugs.r-project.org/show_bug.cgi?id=18430> that > > relates to the layout of the Rcomplex typedef. Previou

[Rd] Breaking Change in Rcomplex Layout?

2023-04-03 Thread Michael Milton
Hi all, There seems to have been a breaking change in the R trunk caused by a fix to bug 18430 that relates to the layout of the Rcomplex typedef. Previously it was a struct, but now it's a union by default

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

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("`",

[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

[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

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

[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

Re: [Rd] trace() an S3-classed function in .GlobalEnv

2022-06-08 Thread Michael Chirico
o)) # [1] "original" "source" "class" PS one day I hope to master the dark art of choosing r-devel or bugzilla for issues :) On Wed, Jun 8, 2022 at 3:44 AM Martin Maechler wrote: > > >>>>> Michael Chirico > >>>>> on Mon, 6 Ju

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] .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

[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] translation domain is not inferred correctly from a package's print methods -- intended behavior?

2021-07-12 Thread Michael Chirico
Here is a reprex: # initialize reprex package cd /tmp mkdir myPkg && cd myPkg echo "Package: myPkg" > DESCRIPTION echo "Version: 0.0.1" >> DESCRIPTION mkdir R echo "print.my_class = function(x, ...) { cat(gettext(\"'%s' is deprecated.\"), '\n', gettext(\"'%s' is deprecated.\", domain='R-myPkg'), '

[Rd] tools::update_pkg_po() doesn't work on Solaris?

2021-07-11 Thread Michael Chirico
Hi all, I am about 99% sure tools::update_pkg_po() is using an invocation that is not supported by the Solaris version of msgfmt. The invocation[1]: msgfmt -c --statistics -o /path/to/file.mo /path/to/file.po AFAICT neither -c nor --statistics appear to be supported by Solaris [2]: I don't hav

Re: [Rd] Should last default to .Machine$integer.max-1 for substring()

2021-06-21 Thread Michael Chirico
on, Jun 21, 2021 at 1:32 AM Martin Maechler wrote: > > >>>>> Tomas Kalibera > >>>>> on Mon, 21 Jun 2021 10:08:37 +0200 writes: > > > On 6/21/21 9:35 AM, Martin Maechler wrote: > >>>>>>> Michael Chirico > >&g

[Rd] Should last default to .Machine$integer.max-1 for substring()

2021-06-20 Thread Michael Chirico
Currently, substring defaults to last=100L, which strongly suggests the intent is to default to "nchar(x)" without having to compute/allocate that up front. Unfortunately, this default makes no sense for "very large" strings which may exceed 100L in "width". The max width of a string is .

Re: [Rd] reshape documentation

2021-03-17 Thread Michael Dewey
y have more than one set of variables which need to correspond to a single variable in long format. So in your example if you also had 11 variables for the temperature as well as the concentration each would need specifying as a separate vector in the list. Michael reshape(Indometh,

Re: [Rd] issue with data()

2021-02-16 Thread Michael Dewey
Dear Terry Option 2 looks the best to me. They have a relatively simple change to make and there are only four of them. Michael On 16/02/2021 14:39, Therneau, Terry M., Ph.D. via R-devel wrote: I am testing out the next release of survival, which involves running R CMD check on 868 CRAN

[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] usage of #import in grDevices/src/qdCocoa.h

2020-10-18 Thread Michael Chirico
Is this something that should be updated to use #include? Other packages appear to have done so, e.g. from GitHub: https://github.com/search?q=%22%23include+cocoa%2Fcocoa.h%22&type=code Michael Chirico [[alternative HTML version deleted]] __

[Rd] stats::screeplot suggestion

2020-06-18 Thread Michael Friendly
the X axis: "Component" In the would-be-nice-if category, I suggest addition of a type="cumulative" chart, a line graph of cumulative % of variance, labeled "% Variance" by default. -Michael - screeplot.default.R - screeplot.default <- function (x, npcs = m

Re: [Rd] Translations and snprintf on Windows

2020-06-05 Thread Michael Chirico
the issue (AFAICT via trioremap.h). On Thu, Apr 30, 2020 at 4:16 PM Michael Chirico wrote: > [a bit unsure on if this is maybe better for r-package-devel] > > We recently added translations to messages at the R and C level to > data.table. > > At the C level, we did _() wrappi

Re: [Rd] Should 0L * NA_integer_ be 0L?

2020-05-23 Thread Michael Chirico
ltiplication of logical values even means). FALSE * NA = 0L On Sat, May 23, 2020 at 6:49 PM Martin Maechler wrote: > > >>>>> Michael Chirico > >>>>> on Sat, 23 May 2020 18:08:22 +0800 writes: > > > I don't see this specific case documented

[Rd] Should 0L * NA_integer_ be 0L?

2020-05-23 Thread Michael Chirico
I don't see this specific case documented anywhere (I also tried to search the r-devel archives, as well as I could); the only close reference mentions NA & FALSE = FALSE, NA | TRUE = TRUE. And there's also this snippet from R-lang: In cases where the result of the operation would be the same for

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] Translations and snprintf on Windows

2020-04-30 Thread Michael Chirico
the use of snprintf specifically appears to have caused a crash on Windows: https://github.com/Rdatatable/data.table/issues/4402 Is there any guidance against using gettext with snprintf, or perhaps guidance on which "outputters" *are* OK for translation? Michael Chirico [[a

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

2020-04-16 Thread Michael Mahoney
This syntax is already implemented in the {purrr} package, more or less -- you need to add a tilde before your function call for it to work exactly as written: purrr::map_dbl(split(mtcars, mtcars$cyl), ~ summary(lm(wt ~ mpg, .))$r.squared) is equivalent to sapply(split(mtcars, mtcars$cyl), funct

Re: [Rd] [SPAM] Hard memory limit of 16GB under Windows?

2020-04-07 Thread Michael Dewey
Dear Samuel Does the FAQ for Windows section 2.9 help you here? Michael On 07/04/2020 12:35, Samuel Granjeaud IR/Inserm wrote: Hi, I am not not sure whether this topic belongs to this mail list, but I feel the subscribers here should be the right audience. I noticed that the memory limit

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] 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] Default for checkBuilt in update.packages() should be TRUE

2020-02-24 Thread Michael Dewey
I suppose it is too late to change the name but checkBuilt does not immediately clarify to me what it does. It does not check whether I have built a package for instance. Having read Duncan's post at least I now know that I should set it as TRUE until the default is changed. Michael On

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

[Rd] re-submission of package after CRAN-pretest notes

2020-01-08 Thread Michael Friendly
like to re-submit. -Michael -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychology Dept. & Chair, ASA Statistical Graphics Section York University Voice: 416 736-2100 x66249 4700 Keele StreetWeb: http://www.datavis.ca | @datavisFriendly Toronto, ONT M3J

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

[Rd] passing extra arguments to devtools::build

2019-09-27 Thread Michael Friendly
LL,args =character(),error_on_status =TRUE,:System command error| I've tried other alternatives with other |devtools| commands, like just passing a single argument, but still get the same error |args ='--compact-vignettes="gs+qpdf"'devtools::check_win_devel(args=arg

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] 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] head.matrix can return 1000s of columns -- limit to n or add new argument?

2019-09-16 Thread Michael Chirico
Awesome. Gabe, since you already have a workshopped version, would you like to proceed? Feel free to ping me to review the patch once it's posted. On Mon, Sep 16, 2019 at 3:26 PM Martin Maechler wrote: > >>>>> Michael Chirico > >>>>>

Re: [Rd] head.matrix can return 1000s of columns -- limit to n or add new argument?

2019-09-15 Thread Michael Chirico
is quite clear for those familiar with head(x, 6), it would seem to me. Mike C On Sat, Jul 13, 2019 at 8:35 AM Gabriel Becker wrote: > Hi Michael and Abby, > > So one thing that could happen that would be backwards compatible (with > the exception of something that was an error n

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

[Rd] --disable-long-double or --enable-long-double=no?

2019-08-21 Thread Michael Chirico
& the ambiguity is immediate -- the commit mentions disable-long-double but builds enable-long-double. https://github.com/wch/r-source/commit/fb8e36f8be0aaf47a9c54c9effb219dae34f0e41 Could someone please help to clear the confusion? Thanks Michael Chirico [[

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

[Rd] Why no tz argument for format.POSIXlt?

2019-08-13 Thread Michael Chirico
;format" "usetz" "..." Is there any reason not to accept a tz argument for format.POSIXlt? It's quite convenient to be able to specify an output timezone format on the fly with format.POSIXct; in the case at hand, I'm trying to

[Rd] iconv: embedded nulls when converting to UTF-16

2019-08-05 Thread Braun, Michael
threads from June 2010 and February, 2016, and that bug #16738 was posted to Bugzilla as a result. However, I have not been able to determine if the error is mine, if there is a known workaround, or it truly is a bug in R’s iconv implementation. Any additional help is appreciated. Thanks, Michael

[Rd] bug: write.dcf converts hyphen in field name to period

2019-08-02 Thread Michael Chirico
#x27;', gsub('[^\U{0021}-\U{0039}\U{003B}-\U{007E}]', '.', names(x))) (Or maybe errors for having invalid names) Michael Chirico [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

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] 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] 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] head.matrix can return 1000s of columns -- limit to n or add new argument?

2019-07-08 Thread Michael Chirico
I think of head() as a standard helper for "glancing" at objects, so I'm sometimes surprised that head() produces massive output: M = matrix(nrow = 10L, ncol = 10L) print(head(M)) # <- beware, could be a huge print I assume there are lots of backwards-compatibility issues as well as valid use

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] rbind has confusing result for custom sub-class (possible bug?)

2019-06-02 Thread Michael Chirico
gt; > > > Follow-up (inline) on my comment about a potential issue in `[<-.Date`. > > > > On Mon, May 27, 2019 at 9:31 AM Michael Chirico > > wrote: > > > > > > Yes, thanks for following up on thread here. And thanks again for > clearing things up,

[Rd] Why is R in Japanese (only in Mac terminal)?

2019-05-29 Thread Michael Chirico
Since a while ago, R on my Mac terminal is being started in Japanese: R version 3.5.2 (2018-12-20) -- "Eggshell Igloo" Copyright (C) 2018 The R Foundation for Statistical Computing Platform: x86_64-apple-darwin15.6.0 (64-bit) R は、自由なソフトウェアであり、「完全に無保証」です。 一定の条件に従えば、自由にこれを再配布することができます。 配布条件の詳細

  1   2   3   4   5   6   7   >