Re: [Rd] Suggestion: Add box constraints to optim() default Nelder-Mead

2025-09-17 Thread Ben Bolker
For what it's worth: John Nash (original author of the Pascal implementations of (most of) the available algorithms in optim() (including the Nelder-Mead)) has long maintained that these implementations could be updated. (Any update that changed solutions, rather than adding new functionalit

[Rd] Suggestion: Add box constraints to optim() default Nelder-Mead

2025-09-17 Thread ivo welch
Title says it all. I know this can be done by transformations by the user, but given that interval is so prominent in the ?doc and given that Nelder-Mead is the default method for optim(), it would be nice if the default method would honor this one, too. [could be done (even by me) within the R c

Re: [Rd] [BUG?] S4 validity function not enforced during object creation in R 4.4.2

2025-09-17 Thread Mikael Jagan
Dear Yingkai, The default method for 'initialize', which is called by 'new' in your example and is accessible as > selectMethod("initialize", "ANY") has always called 'validObject' *only if* it finds arguments matching '...', so the behaviour that you report is not a change from earlier beh

Re: [Rd] Declaring Types at Function Declaration

2025-09-17 Thread ivo welch
thanks. (indeed, on this one, even I knew this can be done, and only at runtime, of course, for all generality. ;-)). My suggestion was only for a little syntactic sugar. python has something like it, too. [[alternative HTML version deleted]] ___

Re: [Rd] compiler::cmpfile output contains source code

2025-09-17 Thread Ivan Krylov via R-devel
В Wed, 10 Sep 2025 16:13:25 -0700 helgasoft пишет: > Command compiler::cmpfile(infile) outputs a binary (.Rc) file. > The infile source code is contained in this output file. > Is the source code required, and if not, is it possible to make it > optional ? The source references are optional. Si

Re: [Rd] Declaring Types at Function Declaration

2025-09-17 Thread Henrik Bengtsson
There's also base::declare() in R (>= 4.4.0), which people are exploring to programmatically declare types and other things (https://github.com/HenrikBengtsson/Wishlist-for-R/issues/169). For example, Tomasz Kalinowski uses it in 'quickr' for guiding the "R to Fortran Transpiler" (https://github.co

Re: [Rd] Declaring Types at Function Declaration

2025-09-17 Thread Duncan Murdoch
On 2025-09-17 1:23 p.m., IVO I WELCH wrote: Suggestion for Syntax Sugar: Would it make sense to permit a simple way to allow a coder to document the function argument type? f <- function( a:chr, b:data.frame, c:logi ) { … } presumably, what comes behind the ‘:’ should match what ‘str’ return

[Rd] Declaring Types at Function Declaration

2025-09-17 Thread IVO I WELCH
Suggestion for Syntax Sugar: Would it make sense to permit a simple way to allow a coder to document the function argument type? f <- function( a:chr, b:data.frame, c:logi ) { … } presumably, what comes behind the ‘:’ should match what ‘str’ returns. however, this need not be checked (except