search for: unquot

Displaying 20 results from an estimated 250 matches for "unquot".

Did you mean: unquote
2010 May 07
0
A fix that for 'bquote' that may work (PR#14031)
...hz.ch, R-bugs at r-project.org > Date: Friday, 6 November, 2009, 11:42 PM > On Thu, 5 Nov 2009, suharto_anggono at yahoo.com > wrote: > > > This is a fix for 'bquote' that may work. > > > > function (expr, where =3D parent.frame())=20 > > { > >? ? unquote <- function(e) { > >? ? ? ? if (length(e) <=3D 1 || > !is.language(e))=20 > >? ? ? ? ? ? e > >? ? ? ? else if (e[[1]] =3D=3D > as.name("."))=20 > >? ? ? ? ? ? eval(e[[2]], > where) > >? ? ? ? else as.call(lapply(e, > unquote)) > >? ?...
2006 Aug 20
3
unquoting
...his: > A <- matrix(1:6, nrow = 2, ncol=3) > AF <- as.data.frame(A) > names(AF) <- c("First","Second","Third") > AF First Second Third 1 1 3 5 2 2 4 6 > names(AF)[2] [1] "Second" > attach(AF) > unquote(names(AF)[2]) [1] 3 4 Of course what I actually get is Error: couldn't find function "unquote" The reason that I want to do this is that I have a frame with a rather large number of variables and I would like to loop over the names and print out various descriptive summaries of...
2017 Oct 16
3
[PATCH v2 0/2] daemon: add and use split_key_value_strings helper
Changes from v1 to v2: - split the "simple unquoting" as helper - pass the unquoting function to split_key_value_strings - use right unquoting function when applying split_key_value_strings Pino Toscano (2): daemon: add split_key_value_strings helper daemon: use split_key_value_strings daemon/inspect_fs_unix.ml | 93 +++++++++++++++++++...
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 Oct 16
3
[PATCH v3 0/2] daemon: add and use parse_key_value_strings helper
Changes from v2 to v3: - split_key_value_strings renamed to parse_key_value_strings Changes from v1 to v2: - split the "simple unquoting" as helper - pass the unquoting function to split_key_value_strings - use right unquoting function when applying split_key_value_strings Pino Toscano (2): daemon: add split_key_value_strings helper daemon: use parse_key_value_strings daemon/inspect_fs_unix.ml | 93 +++++++++++++++++++...
2017 Oct 16
2
Re: [PATCH v2 1/2] daemon: add split_key_value_strings helper
On Mon, Oct 16, 2017 at 05:58:10PM +0200, Pino Toscano wrote: > Add a simple helper to turn a list of strings into key/value pairs, > splitting by '=', with the possibility to apply a function to unquote > values. > > Add also a simple unquote function. > --- > daemon/utils.ml | 16 ++++++++++++++++ > daemon/utils.mli | 11 +++++++++++ > 2 files changed, 27 insertions(+) > > diff --git a/daemon/utils.ml b/daemon/utils.ml > index d87ad75db..865936280 100644 > --...
2009 Oct 29
0
In the result of applying 'bquote' to function definition with 2 or more arguments, first function argument disappears (PR#14031)
...ted differently. They are printed identically when useSource=FALSE. The first argument disappears, error when 'eval'-ed. But, apparently, if the function has one or zero argument, applying 'bquote' results fine. I try to debug. In the definition of 'bquote', there is 'unquote' function. > bquote function (expr, where = parent.frame()) { unquote <- function(e) { if (length(e) <= 1) e else if (e[[1]] == as.name(".")) eval(e[[2]], where) else as.call(lapply(e, unquote)) } unquote(substitu...
2017 Mar 17
2
RFC: (in-principle) native unquoting for standard evaluation
...e breaks this however. * itself would have been a nice operator for this were it not prone to ambiguity (`a * *b` vs `a**b`, from which @ does not suffer). Would this extension require that function authors explicitly enable auto-quoting support? I somewhat envisioned functions seeing the resolved unquoted object (within their calling scope) so that they could retain their standard defintions when not using @. In my mutate example, mutate itself could simply be the NSE version, so mutate(mtcars, z = mpg) would work as normal, but x = "mpg" mutate(mtcars, z = @x) would prod...
2017 Mar 17
4
RFC: (in-principle) native unquoting for standard evaluation
(please be gentle, it's my first time) I am interested in discussions (possibly reiterating past threads -- searching didn't turn up much) on the possibility of supporting standard evaluation unquoting at the language level. This has been brought up in a recent similar thread here [1] and on Twitter [2] where I proposed the following desired (in-principle) syntax f <- function(col1, col2, new_col_name) { mtcars %>% mutate(@new_col_name = @col1 + @col2) } or closer to ho...
2017 Oct 16
0
[PATCH v2 1/2] daemon: add split_key_value_strings helper
Add a simple helper to turn a list of strings into key/value pairs, splitting by '=', with the possibility to apply a function to unquote values. Add also a simple unquote function. --- daemon/utils.ml | 16 ++++++++++++++++ daemon/utils.mli | 11 +++++++++++ 2 files changed, 27 insertions(+) diff --git a/daemon/utils.ml b/daemon/utils.ml index d87ad75db..865936280 100644 --- a/daemon/utils.ml +++ b/daemon/utils.ml @@ -229,3 +22...
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 definition of the problem, and a solution that probably involves rotating the AST accordingly (see ht...
2017 Mar 19
0
RFC: (in-principle) native unquoting for standard evaluation
..., expanding calls like that is somewhat orthogonal >> to NSE. It would be nice in general to be able to write something like >> mean(x, extra_args...) without resorting to do.call(mean, c(list(x), >> extra_args)). If we had that then uqs() would just be the combination >> of unquote and expansion, i.e., mean(x, @extra_args...). The "..." >> postfix would not work since it's still a valid symbol name, but we >> could come up with something. > > > I've been trying to follow this proposal, though without tracking down > all the tweets, e...
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 as.expression(lapply(l...
2017 Mar 17
2
Support for user defined unary functions
>After off list discussions with Jonathan Carrol and with >Michael Lawrence I think it's doable, unambiguous, >and even imo pretty intuitive for an "unquote" operator. For those of us who are not CS/Lisp mavens, what is an "unquote" operator? Can you expression quoting and unquoting in R syntax and show a few examples where is is useful, intuitive, and fits in to R's functional design? In particular, what does it give us that the...
2017 Mar 19
3
RFC: (in-principle) native unquoting for standard evaluation
...au > <javascript:;>> > wrote: > > > (please be gentle, it's my first time) > > > > I am interested in discussions (possibly reiterating past threads -- > > searching didn't turn up much) on the possibility of supporting standard > > evaluation unquoting at the language level. This has been brought up in a > > recent similar thread here [1] and on Twitter [2] where I proposed the > > following desired (in-principle) syntax > > > > f <- function(col1, col2, new_col_name) { > > mtcars %>% mutate(@new...
2007 May 15
5
Trying to make tidy{} work
...assessment": age => "1w", backup => false, type => mtime, } ? It doesn''t appear to. Am I missing ''recurse => true''? What''s the syntax & quoting for ''age''? quoted, no space : "1w" unquoted, no space : 1w quoted, with space : "1 w" unquoted, with space: 1 w Can I wildcard the files to tidy? Note that the nice people who made Tomcat/Struts/whatever hide a "tldCache.ser" file in with all the stale "strts####.tmp" files and it''d be ni...
2010 Nov 03
2
How to unquote string in R
...t; table = rbind(s,a) write.table(table,paste("blah",".PROPERTIES",sep = ""),row.names = FALSE,col.names = FALSE) In my table, how do I output only the words and not the words with the quotations? -- View this message in context: http://r.789695.n4.nabble.com/How-to-unquote-string-in-R-tp3025654p3025654.html Sent from the R help mailing list archive at Nabble.com.
2017 Mar 19
0
RFC: (in-principle) native unquoting for standard evaluation
...y_ evaluation). For the uqs() thing, expanding calls like that is somewhat orthogonal to NSE. It would be nice in general to be able to write something like mean(x, extra_args...) without resorting to do.call(mean, c(list(x), extra_args)). If we had that then uqs() would just be the combination of unquote and expansion, i.e., mean(x, @extra_args...). The "..." postfix would not work since it's still a valid symbol name, but we could come up with something. Michael On Sat, Mar 18, 2017 at 7:39 PM, Hadley Wickham <h.wickham at gmail.com> wrote: > Would this return a quosure?...
2017 Mar 17
0
RFC: (in-principle) native unquoting for standard evaluation
...2017 at 5:03 PM, Jonathan Carroll <jono at jcarroll.com.au> wrote: > (please be gentle, it's my first time) > > I am interested in discussions (possibly reiterating past threads -- > searching didn't turn up much) on the possibility of supporting standard > evaluation unquoting at the language level. This has been brought up in a > recent similar thread here [1] and on Twitter [2] where I proposed the > following desired (in-principle) syntax > > f <- function(col1, col2, new_col_name) { > mtcars %>% mutate(@new_col_name = @col1 + @col2...
2017 Mar 19
3
RFC: (in-principle) native unquoting for standard evaluation
...the uqs() thing, expanding calls like that is somewhat orthogonal > to NSE. It would be nice in general to be able to write something like > mean(x, extra_args...) without resorting to do.call(mean, c(list(x), > extra_args)). If we had that then uqs() would just be the combination > of unquote and expansion, i.e., mean(x, @extra_args...). The "..." > postfix would not work since it's still a valid symbol name, but we > could come up with something. I've been trying to follow this proposal, though without tracking down all the tweets, etc. that are referenced....