similar to: A fix that for 'bquote' that may work (PR#14031)

Displaying 20 results from an estimated 4000 matches similar to: "A fix that for 'bquote' that may work (PR#14031)"

2020 Mar 17
0
new bquote feature splice does not address a common LISP @ use case?
Hi Jan, In the lisp code you provide the operators are parsed as simple symbols in a pairlist. In the R snippet, they are parsed as left-associative binary operators of equal precedence. If you unquote a call in the right-hand side, you're artificially bypassing the left-associativity of these operators. To achieve what you're looking for in a general way, you'll need a more precise
2009 Oct 29
0
In the result of applying 'bquote' to function definition with 2 or more arguments, first function argument disappears (PR#14031)
Full_Name: Suharto Anggono Version: 2.8.1 OS: Windows Submission from: (NULL) (125.165.81.124) Sorry for repost. There is already PR#9602, but the problem is still there. There is also a post "Re: [R] using bquote to construct function" in R-help 2008-10-02. This illustrates the problem. C:\Program Files\R\R-2.8.1\bin>R --vanilla R version 2.8.1 (2008-12-22) Copyright (C) 2008
2020 Mar 17
3
new bquote feature splice does not address a common LISP @ use case?
Dear R-devel, There is a new feature in R-devel, which explicitly refers to LISP @ operator for splicing. > The backquote function bquote() has a new argument splice to enable splicing a computed list of values into an expression, like ,@ in LISP's backquote. Although the most upvoted SO question asking for exactly LISP's @ functionality in R doesn't seems to be addressed by this
2017 Mar 17
0
Support for user defined unary functions
Bill, Right. My example was the functional form for clarity. There is a desire for a unary-operator form. (rlang's !! and !!! operators described in the comments in the file I linked to). I can't really make that argument because I'm not one of the people who wanted that. You'd have to talk to the authors of the rlang package to find out their reasons for thinking that is
2016 Oct 19
0
How to assign NULL value to pairlist element while keeping it a pairlist?
On Wed, 19 Oct 2016, Henrik Bengtsson wrote: > On Sat, Oct 15, 2016 at 2:00 AM, Martin Maechler > <maechler at stat.math.ethz.ch> wrote: >>>>>>> Michael Lawrence <lawrence.michael at gene.com> >>>>>>> on Wed, 12 Oct 2016 15:21:13 -0700 writes: >> >> > Thanks, this was what I expected. There is a desire to >>
2017 Mar 17
2
Support for user defined unary functions
Your example x = 5 exp = parse(text="f(uq(x)) + y +z") # expression: f(uq(x)) +y + z do_unquote(expr) # -> the language object f(5) + y + z could be done with the following wrapper for bquote my_do_unquote <- function(language, envir = parent.frame()) { if (is.expression(language)) { # bquote does not go into expressions, only calls
2010 Jan 25
2
Two == expressions in bquote
Hi, I want to put text on a plot containing something like: a = b^2 = <squared numeric value of b> using bquote. Example: mu = 5 plot(1:10,1:10) text(2,8, bquote(delta == mu^2)) # This works text(2.5,8, bquote(phantom(0) == .(mu^2))) # but is unpredictable text(2,8, bquote(delta == mu^2 == .(mu^2))) # This doesn't work The last text function returns the error:
2008 Oct 02
1
using bquote to construct function
Hi, R-help, (sessionInfo at the end) I'm trying to construct a function using bquote and running into a strange error message. As an example, what I would like to do is this: z <- 2 eval(bquote(function(x, y) { x^.(z) + y }))(2, 3) However, I get the following: Error in eval(expr, envir, enclos) : invalid formal argument list for "function" However, if I change the
2006 Feb 10
1
?bquote
?bquote says it returns an expression but, in fact, it typically (though not always) returns a call object: > class(bquote(a+b)) [1] "call" > class(bquote(1)) [1] "numeric"
2016 Oct 19
2
How to assign NULL value to pairlist element while keeping it a pairlist?
On Sat, Oct 15, 2016 at 2:00 AM, Martin Maechler <maechler at stat.math.ethz.ch> wrote: >>>>>> Michael Lawrence <lawrence.michael at gene.com> >>>>>> on Wed, 12 Oct 2016 15:21:13 -0700 writes: > > > Thanks, this was what I expected. There is a desire to > > eliminate the usage of pairlist from user code, which > >
2013 Jan 04
1
Using bquote to create names a for a list
Hello, How would i use bquote to create names for a list. e.g. to create list(a=10) bquote(list(.(X)=10), list(X="a")) does not work. The best i could come up with is bquote({ a=list(10);names(a)=.(X); a}, list(X="a")) which is quite ugly. Is there an elegant way to solve this? Regards Saptarshi [[alternative HTML version deleted]]
2015 Jul 15
0
bquote/evalq behavior changed in R-3.2.1
I think rapply() was changed to act like lapply() in this respect. In R-3.1.3 we got rapply(list(quote(1+myNumber)), evalq, envir=list2env(list(myNumber=17))) #[1] 18 rapply(list(quote(1+myNumber)), eval, envir=list2env(list(myNumber=17))) #Error in (function (expr, envir = parent.frame(), enclos = if (is.list(envir) || : object 'myNumber' not found lapply(list(quote(1+myNumber)),
2015 Jul 15
0
bquote/evalq behavior changed in R-3.2.1
Another aspect of the change is (using TERR's RinR package): > options(REvaluators=list(makeREvaluator("R-3.1.3"), makeREvaluator("R-3.2.0"))) > RCompare(rapply(list(quote(function(x)x),list(quote(pi),quote(7-4))), function(arg)typeof(arg))) R version 3.1.3 (2015-03-09) R version 3.2.0 (2015-04-16) [1,] [1]
2015 Jul 15
0
bquote/evalq behavior changed in R-3.2.1
Bill, Is your conclusion to just update the code and enforce using the most recent version of R? Dayne On Wed, Jul 15, 2015 at 4:44 PM, Dayne Filer <dayne.filer at gmail.com> wrote: > David, > > If you are referring to the solution that would be: > > rapply(list(test), eval, envir = fenv) > > I thought I explained in the question that the above code does not work.
2011 Jun 23
1
Saved EPS does not match screen when using bquote(.(i))
Here's a fairly minimal-case example in which the saved EPS does not match the screen. The error comes when using bquote(.(i)) instead of bquote(1), as demonstrated by the two minimally different cases below. Very strange. Any clues as to why? #---------------- begin ------------------- # Version A. X axis labels have subscripts as constants. EPS is correct. windows() layout( matrix( 1:2 ,
2008 Apr 02
1
Trouble combining plotmath, bquote, expressions
I'm using R-2.6.2 on Fedora Linux 9. I've been experimenting with plotmath. I wish it were easier to combine expressions in plotmath with values from the R program itself. There are two parameters in the following example, the mean "mymean" and standard deviation "mystd". I am able to use bquote to write elements into the graph title like mu = mymean and R will
2015 Jul 15
0
bquote/evalq behavior changed in R-3.2.1
I am curious why you used evalq instead of eval in this code. Bill Dunlap TIBCO Software wdunlap tibco.com On Wed, Jul 15, 2015 at 11:49 AM, Dayne Filer <dayne.filer at gmail.com> wrote: > Hello, > > I upgraded from 3.1.2 to 3.2.1 and am receiving errors on code that worked > as I intended previously. Briefly, I am using bquote to generate > expressions to modify data.table
2008 Jun 25
0
Use plotmath expressions read from a text file in mtext/bquote
Hello R-help List I am writing some R scripts to create graphs of water quality trends that will be called by a web service running R. The axis titles will need to change as the input data (ie. water quality variable) changes according to a user's choice made via a web page. The way I am currently passing call-specific parameters to the R script is via a text file created on the fly by the
2011 Nov 24
1
Changing graphic titles when using bquote and resizing the graphic window
Dear list, I found a strange behavior of the graphic display when using bquote to set a title to a plot. The problem arise when you manually resize the graphic window using the mouse. It happens on both quartz and x11 devices. Here's a reproducible example: par(mfrow = c(1,3)) for (i in 1:3){ title <- as.expression(bquote(gamma[.(i)])) plot(1:10, main = title) } Once you ran the
2006 Jul 30
3
main= bquote(paste("Results for ", beta, "3", ==.(b1)))) doesn't work.
Hi, I need to plot the beta as the symbol, followed by the index 3 as the title of a graph. This code works> main= bquote(paste("Results for ", beta ==.(b1)) but I also need the index 3. I tried (simplified): >plot(x,y, main= bquote(paste("Results for ", beta, "3", ==.(b1)))) and a few other versions, but I can not get it to run properly. Any help would