Re: [R-pkg-devel] R feature suggestion: Duplicated function arguments check

2021-11-10 Thread Vincent van Hees
Thanks for your replies, I only just noticed them as I had daily-digest = true and someone seems to have removed my e-mail address when replying to the list. Never mind, I have now switched my daily-digest to false. Yes - The issue is that "myfun(A = 1, B = 2, B = 4)" in the example below is

Re: [R-pkg-devel] R feature suggestion: Duplicated function arguments check

2021-11-08 Thread J C Nash
ing an arbitrary fix. R lists are more like a BAG data structure than a SET. -Original Message- From: R-package-devel On Behalf Of Vincent van Hees Sent: Monday, November 8, 2021 11:25 AM To: Duncan Murdoch Cc: r-package-devel@r-project.org Subject: Re: [R-pkg-devel] R feature suggestion: Dupli

Re: [R-pkg-devel] R feature suggestion: Duplicated function arguments check

2021-11-08 Thread Duncan Murdoch
och Cc: r-package-devel@r-project.org Subject: Re: [R-pkg-devel] R feature suggestion: Duplicated function arguments check Thanks Duncan, I have tried to make a minimalistic example: myfun = function(...) { input = list(...) mysum = function(A = c(), B= c()) {

Re: [R-pkg-devel] R feature suggestion: Duplicated function arguments check

2021-11-08 Thread Avi Gross via R-package-devel
1 11:25 AM To: Duncan Murdoch Cc: r-package-devel@r-project.org Subject: Re: [R-pkg-devel] R feature suggestion: Duplicated function arguments check Thanks Duncan, I have tried to make a minimalistic example: myfun = function(...) { input = list(...) mysum = function(A = c(), B= c()) {

Re: [R-pkg-devel] R feature suggestion: Duplicated function arguments check

2021-11-08 Thread Vincent van Hees
Thanks Duncan, I have tried to make a minimalistic example: myfun = function(...) { input = list(...) mysum = function(A = c(), B= c()) { return(A+B) } if ("A" %in% names(input) & "B" %in% names(input)) { print(mysum(A = input$A, B = input$B)) } } # test: > myfun(A = 1, B = 2,

Re: [R-pkg-devel] R feature suggestion: Duplicated function arguments check

2021-11-08 Thread Avi Gross via R-package-devel
8, 2021 11:04 AM To: Vincent van Hees ; r-package-devel@r-project.org Subject: Re: [R-pkg-devel] R feature suggestion: Duplicated function arguments check On 08/11/2021 10:29 a.m., Vincent van Hees wrote: > Not sure if this is the best place to post this message, as it is more > of a sugg

Re: [R-pkg-devel] R feature suggestion: Duplicated function arguments check

2021-11-08 Thread Duncan Murdoch
On 08/11/2021 10:29 a.m., Vincent van Hees wrote: Not sure if this is the best place to post this message, as it is more of a suggestion than a question. When an R function accepts more than a handful of arguments there is the risk that users accidentally provide arguments twice, e.g myfun(A=1,

[R-pkg-devel] R feature suggestion: Duplicated function arguments check

2021-11-08 Thread Vincent van Hees
Not sure if this is the best place to post this message, as it is more of a suggestion than a question. When an R function accepts more than a handful of arguments there is the risk that users accidentally provide arguments twice, e.g myfun(A=1, B=2, C=4, D=5, A=7), and if those two values are