> Duncan Murdoch
> on Mon, 15 Nov 2021 13:06:23 -0500 writes:
> I'd recommend responding now with a pointer to that bug
> report: whoever at CRAN is dealing with your package
> doesn't necessarily know about the bug report. You might
> or might not need to make a chan
I'd recommend responding now with a pointer to that bug report: whoever
at CRAN is dealing with your package doesn't necessarily know about the
bug report. You might or might not need to make a change in the end,
but if you do, it could be hard to meet the two week deadline.
Duncan Murdoch
O
Thank you, I was given a deadline of two weeks to respond, hopefully this
will be settled by then.
Best wishes,
Adrian
On Mon, 15 Nov 2021 at 19:28, Duncan Murdoch
wrote:
> This looks as though it is related to the recent patch in
>
>https://bugs.r-project.org/show_bug.cgi?id=18232
>
> I thi
This looks as though it is related to the recent patch in
https://bugs.r-project.org/show_bug.cgi?id=18232
I think you should probably wait until that settles down before worrying
about it.
Duncan Murdoch
On 15/11/2021 12:18 p.m., Adrian Dușa wrote:
Dear R wizards,
I have recently been i
Dear R wizards,
I have recently been informed about some build errors of my package QCA,
which I was able to trace down to the base function substitute(), with the
following replication example:
foo <- function(x) return(substitute(x))
In the stable R version 4.0.5, I get the expected result:
>
On 18/03/2020 1:36 a.m., Jan Gorecki wrote:
Dear R-devel,
Is there anything that we can do to make output of those call more
consistent? So the first one will return `c(1L, 2L)` rather than
`1:2`. Note that it is not related to compact integer sequence
introduced by altrep, it is reproducible on
Dear R-devel,
Is there anything that we can do to make output of those call more
consistent? So the first one will return `c(1L, 2L)` rather than
`1:2`. Note that it is not related to compact integer sequence
introduced by altrep, it is reproducible on R 3.1.0 as well.
substitute(v+x, list(x=c(1L
Assuming you are fine with a pairlist instead of a list avoiding the
`as.list()` call for dots2 saves a reasonable amount of time and makes it
clearly the fastest.
library(rlang)
dots1 <- function(...) as.list(substitute(list(...)))[-1L]
dots2 <- function(...) as.list(substitute(...()))
dots2.5 <
A potential solution, at least in terms of producing the desired output, is the
base R function alist:
> alist(1+2, "a", rnorm(3))
[[1]]
1 + 2
[[2]]
[1] "a"
[[3]]
rnorm(3)
> str(alist(1+2, "a", rnorm(3)))
List of 3
$ : language 1 + 2
$ : chr "a"
$ : language rnorm(3)
luke
[[altern
Since you're already using bang-bang ;)
library(rlang)
dots1 <- function(...) as.list(substitute(list(...)))[-1L]
dots2 <- function(...) as.list(substitute(...()))
dots3 <- function(...) match.call(expand.dots = FALSE)[["..."]]
dots4 <- function(...) exprs(...)
bench::mark(
dots1(1+2, "a", rno
Thanks all, this was very helpful. Peter's finding - dots2() below -
is indeed interesting - I'd be curious to learn what goes on there.
The different alternatives perform approximately the same;
dots1 <- function(...) as.list(substitute(list(...)))[-1L]
dots2 <- function(...) as.list(substitute
Interestingly,
as.list(substitute(...()))
also works.
On Sun, Aug 12, 2018 at 1:16 PM, Duncan Murdoch
wrote:
> On 12/08/2018 4:00 PM, Henrik Bengtsson wrote:
>>
>> Hi. For any number of *known* arguments, we can do:
>>
>> one <- function(a) list(a = substitute(a))
>> two <- function(a, b) li
On Sun, Aug 12, 2018 at 10:00 PM, Henrik Bengtsson
wrote:
> Hi. For any number of *known* arguments, we can do:
>
> one <- function(a) list(a = substitute(a))
> two <- function(a, b) list(a = substitute(a), b = substitute(b))
>
> and so on. But how do I achieve the same when I have:
>
> dots <- fu
On 12/08/2018 4:00 PM, Henrik Bengtsson wrote:
Hi. For any number of *known* arguments, we can do:
one <- function(a) list(a = substitute(a))
two <- function(a, b) list(a = substitute(a), b = substitute(b))
and so on. But how do I achieve the same when I have:
dots <- function(...) list(???)
Hi. For any number of *known* arguments, we can do:
one <- function(a) list(a = substitute(a))
two <- function(a, b) list(a = substitute(a), b = substitute(b))
and so on. But how do I achieve the same when I have:
dots <- function(...) list(???)
I want to implement this such that I can do:
> e
eval(e)
(of course remove the print(e) once you're sure that it is doing the right
thing)
>
> Thanks, Robert
>
>
>
> -----Original Message-
> From: Duncan Murdoch [mailto:murdoch.dun...@gmail.com]
> Sent: Wednesday, May 15, 2013 6:04 PM
> To: McGehee, Robert
>
On Fri, May 17, 2013 at 2:47 AM, Duncan Murdoch wrote:
> On 13-05-16 11:17 PM, Peter Meilstrup wrote:
>
>> On Thu, May 16, 2013 at 6:06 AM, McGehee, Robert <
>> Robert.McGehee@geodecapital.**com >
>> wrote:
>>
>> Duncan, Thank you for the clarification on how delayedAssign works.
>>> Should
>>> R
On 13-05-16 11:17 PM, Peter Meilstrup wrote:
On Thu, May 16, 2013 at 6:06 AM, McGehee, Robert <
robert.mcge...@geodecapital.com> wrote:
Duncan, Thank you for the clarification on how delayedAssign works. Should
R-level interfaces to promise objects ever become available, I expect they
would at
On Thu, May 16, 2013 at 6:06 AM, McGehee, Robert <
robert.mcge...@geodecapital.com> wrote:
> Duncan, Thank you for the clarification on how delayedAssign works. Should
> R-level interfaces to promise objects ever become available, I expect they
> would at time come in handy.
>
> On the subject of
x)) mydelay(i)
Duncan Murdoch
Thanks, Robert
-Original Message-
From: Duncan Murdoch [mailto:murdoch.dun...@gmail.com]
Sent: Wednesday, May 15, 2013 6:04 PM
To: McGehee, Robert
Cc: R-Devel (r-devel@r-project.org)
Subject: Re: [Rd] Substitute unaware when promise objects are evaluat
this R CMD check warning about .Internal, or is there a
better way to write this code?
Thanks, Robert
-Original Message-
From: Duncan Murdoch [mailto:murdoch.dun...@gmail.com]
Sent: Wednesday, May 15, 2013 6:04 PM
To: McGehee, Robert
Cc: R-Devel (r-devel@r-project.org)
Subject: Re: [Rd]
On 13-05-15 11:54 AM, McGehee, Robert wrote:
R-devel,
I used the 'substitute' function to create labels for objects inside an
environment, without actually evaluating the objects, as the objects might be
promises.
However, I was surprised to see that 'substitute' returns the expression slot of
R-devel,
I used the 'substitute' function to create labels for objects inside an
environment, without actually evaluating the objects, as the objects might be
promises.
However, I was surprised to see that 'substitute' returns the expression slot
of the original promise even after the promise h
> Well, yes; you can get there more quickly as follows:
>
>> x <- as.name("foo")
>> attr(x,"id") <- 7913
>> x
> foo
> attr(,"id")
> [1] 7913
>> substitute(foo)
> foo
> attr(,"id")
> [1] 7913
>
> I.e. if you ever put an attribute on a symbol, it stays there "forever". The
> fix is probably to forbi
On Mar 20, 2012, at 22:31 , Hadley Wickham wrote:
> Hi all,
>
> I can't figure out how to make this problem easily reproducible, but I
> can demonstrate it very simply, so I hoped someone might be able to
> suggest a place to start:
>
>> f <- function(x) substitute(x)
>> f(x)
> x
>> f(mpg)
> mp
Hi all,
I can't figure out how to make this problem easily reproducible, but I
can demonstrate it very simply, so I hoped someone might be able to
suggest a place to start:
> f <- function(x) substitute(x)
> f(x)
x
> f(mpg)
mpg
attr(,"id")
[1] 11
It works as expected in a clean R session:
> f <
Full_Name: Bob O'Hara
Version: 2.6.2
OS: Windows
Submission from: (NULL) (128.214.72.197)
Wishlist: This is a documentation problem/complaint/whinge.
The help for substitute() tells us "The typical use of substitute is to create
informative labels for data sets and plots." But the example given
[EMAIL PROTECTED] wrote:
> The first four lines of code below work as normal. The fifth thorows
> an error: "Error in paste(theta[1], "=", 5) : object "theta" not found"
>
>
> x=rnorm(1000);
> bob=density(x);
> topp=5;
> plot(bob,xlab="", ylab="",
> main=substitute(paste(theta[1],"=",topp),lis
The first four lines of code below work as normal. The fifth thorows
an error: "Error in paste(theta[1], "=", 5) : object "theta" not found"
x=rnorm(1000);
bob=density(x);
topp=5;
plot(bob,xlab="", ylab="",
main=substitute(paste(theta[1],"=",topp),list(topp=topp)), type="l");
plot(bob$y~bob$
John Maindonald wrote:
> In this connection, note the following
>
> > a4 <- 4
> > plotThis <- bquote(alpha==.(a), list(a=a4))
> > do.call(plot, list(1:10, main=do.call(expression, c(plotThis
> > do.call(plot, list(1:10, main=do.call(expression, plotThis)))
> Error in do.call(expression, plo
rote:
> From: Peter Dalgaard <[EMAIL PROTECTED]>
> Date: 18 July 2007 1:39:50 AM
> To: Deepayan Sarkar <[EMAIL PROTECTED]>
> Cc: R Development Mailing List <[EMAIL PROTECTED]>
> Subject: Re: [Rd] substitute and expression
>
>
> Deepayan Sarkar wro
Deepayan Sarkar wrote:
> On 7/16/07, Peter Dalgaard <[EMAIL PROTECTED]> wrote:
>
>> Deepayan Sarkar wrote:
>>
>>> Hi,
>>>
>>> I'm trying to understand whether the use of substitute() is
>>> appropriate/documented for plotmath annotation. The following two
>>> calls give the same results:
>>
On 7/16/07, Peter Dalgaard <[EMAIL PROTECTED]> wrote:
> Deepayan Sarkar wrote:
> > Hi,
> >
> > I'm trying to understand whether the use of substitute() is
> > appropriate/documented for plotmath annotation. The following two
> > calls give the same results:
> >
> >
> >> plot(1:10, main = expression
On 7/16/07, Deepayan Sarkar <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm trying to understand whether the use of substitute() is
> appropriate/documented for plotmath annotation. The following two
> calls give the same results:
>
> > plot(1:10, main = expression(alpha == 1))
> > do.call(plot, list(1:10
Deepayan Sarkar wrote:
> Hi,
>
> I'm trying to understand whether the use of substitute() is
> appropriate/documented for plotmath annotation. The following two
> calls give the same results:
>
>
>> plot(1:10, main = expression(alpha == 1))
>> do.call(plot, list(1:10, main = expression(alpha ==
Hi,
I'm trying to understand whether the use of substitute() is
appropriate/documented for plotmath annotation. The following two
calls give the same results:
> plot(1:10, main = expression(alpha == 1))
> do.call(plot, list(1:10, main = expression(alpha == 1)))
But not these two:
> plot(1:10, m
First, by "doesn't work" you mean the printed output. The value
returned is the same.
Second, the problem is not a general one with S4 methods but with
primitive functions. To see this, define a real function with a similar
method:
> setGeneric("foo", function(e1, e2) standardGeneric("foo")
Hi all,
I don't understand why this does not what I expect :
## code start here ##
setClass("num",representation(x="numeric"))
num<-function(x) new("num",x=x)
add<-function(e1,e2) {
cat("Computing
",deparse(substitute(e1)),"+",deparse(substitute(e2)),"\n")
[EMAIL PROTECTED]@x
to be to warn people that
>> keep.source=TRUE
>>>> can be dangerous in this way, both in the help informaton for
>>>> options() and for substitute().
>>>>
>>>> ?
>>>>
>>>> Bill Venables.
>>>>
>>&
ton for
> >> options() and for substitute().
> >>
> >> ?
> >>
> >> Bill Venables.
> >>
> >> -Original Message-
> >> From: Peter Dalgaard [mailto:[EMAIL PROTECTED]
> >> Sent: Friday, 22 December 2006 9:47 PM
> >> To
[EMAIL PROTECTED] (i.e. I) wrote:
> 3. Modify substitute() so that it strips source attributes (or
anything
> else apparently visible that it will not manipulate) from objects.
> Sorry folks, too dangerous. (I concede this appears to be a bit of an
> overkill, too.)
Peter Dalgaard responded:
should strip them when code gets modified.
Duncan Murdoch
>
>> Perhaps the compromise has to be to warn people that keep.source=TRUE
>> can be dangerous in this way, both in the help informaton for options()
>> and for substitute().
>>
>> ?
>>
>> Bi
should strip them when code gets modified.
Duncan Murdoch
>
>> Perhaps the compromise has to be to warn people that keep.source=TRUE
>> can be dangerous in this way, both in the help informaton for options()
>> and for substitute().
>>
>> ?
>>
>> Bi
be dangerous in this way, both in the help informaton for options()
> and for substitute().
>
> ?
>
> Bill Venables.
>
> -Original Message-
> From: Peter Dalgaard [mailto:[EMAIL PROTECTED]
> Sent: Friday, 22 December 2006 9:47 PM
> To: Venables, Bill (CMIS, Cleve
Peter Dalgaard [mailto:[EMAIL PROTECTED]
Sent: Friday, 22 December 2006 9:47 PM
To: Venables, Bill (CMIS, Cleveland)
Cc: r-devel@stat.math.ethz.ch; [EMAIL PROTECTED]
Subject: Re: [Rd] substitute creates an object which prints incorrectly
(PR#9427)
[EMAIL PROTECTED] wrote:
> The function &qu
Try issuing the command:
options(keep.source = FALSE)
prior to running the code you displayed to force the actual source,
rather than the source attribute, to be displayed by print when printing
functions.
On 12/21/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> The function "substitute" s
[EMAIL PROTECTED] wrote:
> The function "substitute" seems to fail to make a genuine
> substitution, although the printed verision seems fine. Here is an
> example.
>
>
>> m <- substitute(Y <- function(x) FUN(x+1),
>>
> + list(Y = as.name("y"), FUN = as.name("sin")))
>
>> m
>>
> y
The function "substitute" seems to fail to make a genuine
substitution, although the printed verision seems fine. Here is an
example.
> m <- substitute(Y <- function(x) FUN(x+1),
+ list(Y = as.name("y"), FUN = as.name("sin")))
> m
y <- function(x) sin(x + 1)
> eval(m)
> y
function(x) FUN(x+1)
H
On 7/28/2006 7:53 AM, [EMAIL PROTECTED] wrote:
> Full_Name: Philip Kensche
> Version: 2.3.0
This version is obsolete, but the error does occur in the current R-patched.
> OS: Redhat Linux
> Submission from: (NULL) (131.174.88.204)
>
>
> Try this:
>
> --
> x <- data.frame(the.first.column=c("A"
On 7/28/2006 7:53 AM, [EMAIL PROTECTED] wrote:
> Full_Name: Philip Kensche
> Version: 2.3.0
This version is obsolete, but the error does occur in the current R-patched.
> OS: Redhat Linux
> Submission from: (NULL) (131.174.88.204)
>
>
> Try this:
>
> --
> x <- data.frame(the.first.column=c("A"
Full_Name: Philip Kensche
Version: 2.3.0
OS: Redhat Linux
Submission from: (NULL) (131.174.88.204)
Try this:
--
x <- data.frame(the.first.column=c("A"), the.second.column=c("b"),
the.third.column=c("d"), and.many.more.columns=c("e"))
by(x, paste(x$the.first.column, x$the.second.column, x$and.ma
On 4/3/2006 8:08 AM, Henrik Bengtsson wrote:
> Follow up: I've downloaded todays R v2.3.0 alpha (2006-04-02 r37626)
> for Windows and the below bug has been fixed:
>
>> yaa <- function(...) substitute(list(...))
>> yaa(foo(x,y,...,z))
> list(foo(x, y, ..., z))
>
> Thank you (Duncan!?)
Yes, I th
Follow up: I've downloaded todays R v2.3.0 alpha (2006-04-02 r37626)
for Windows and the below bug has been fixed:
> yaa <- function(...) substitute(list(...))
> yaa(foo(x,y,...,z))
list(foo(x, y, ..., z))
Thank you (Duncan!?)
Henrik
On 3/29/06, Henrik Bengtsson <[EMAIL PROTECTED]> wrote:
> On
e ---
> From: Peter Dalgaard <[EMAIL PROTECTED]>
> To: "Henrik Bengtsson" <[EMAIL PROTECTED]>
> Cc: r-devel@r-project.org
> Subject: Re: [Rd] Substitute() changed since R2.3.0 (2006-02-02 r37243)?
> Date: 29 Mar 2006 11:58:34 +0200
>
> "Henrik
On 29 Mar 2006 11:58:34 +0200, Peter Dalgaard <[EMAIL PROTECTED]> wrote:
> "Henrik Bengtsson" <[EMAIL PROTECTED]> writes:
>
> > Hi,
> >
> > I've got the following two versions of R on WinXP:
> >
> > A) R Version 2.3.0 Under development (unstable) (2006-02-02 r37243)
> > B) R Version 2.3.0 Under dev
"Henrik Bengtsson" <[EMAIL PROTECTED]> writes:
> Hi,
>
> I've got the following two versions of R on WinXP:
>
> A) R Version 2.3.0 Under development (unstable) (2006-02-02 r37243)
> B) R Version 2.3.0 Under development (unstable) (2006-03-27 r37579)
>
> and a the following "test.R" script:
>
>
Hi,
I've got the following two versions of R on WinXP:
A) R Version 2.3.0 Under development (unstable) (2006-02-02 r37243)
B) R Version 2.3.0 Under development (unstable) (2006-03-27 r37579)
and a the following "test.R" script:
foo <- function(path, ...) { print(path) }
bar <- function(x, ...)
57 matches
Mail list logo