search for: rlang

Displaying 20 results from an estimated 110 matches for "rlang".

Did you mean: clang
2018 Feb 11
4
Parallel assignments and goto
...sions to variables so the expression uses the old variable values and not the new values until the assignments are all done ? and one related to restarting a loop from nested loops or from nested expressions in `with` expressions or similar. I can implement parallel assignment using something like rlang::env_bind: factorial_tr_2 <- function (n, acc = 1) { .tailr_env <- rlang::get_env() repeat { if (n <= 1) return(acc) else { rlang::env_bind(.tailr_env, n = n - 1, acc = acc * n) next } } } This reduces the number o...
2018 Feb 27
2
Parallel assignments and goto
...? ? ? acc <- .tailr_acc ? ? ? ? ? ? if (n <= 1) { ? ? ? ? ? ? ? ? escape(acc) ? ? ? ? ? ? } else { ? ? ? ? ? ? ? ? .tailr_n <<- n - 1 ? ? ? ? ? ? ? ? .tailr_acc <<- n * acc ? ? ? ? ? ? } ? ? ? ? } ? ? }) } factorial_tr_automatic_2 <- function(n, acc = 1) { ? ? .tailr_env <- rlang::get_env() ? ? callCC(function(escape) { ? ? ? ? repeat { ? ? ? ? ? ? if (n <= 1) { ? ? ? ? ? ? ? ? escape(acc) ? ? ? ? ? ? } else { ? ? ? ? ? ? ? ? .tailr_env$.tailr_n <- n - 1 ? ? ? ? ? ? ? ? .tailr_env$.tailr_acc <- n * acc ? ? ? ? ? ? ? ? .tailr_env$n <- .tailr_env$.tailr_n ? ? ? ?...
2018 Feb 26
0
Parallel assignments and goto
...? ? ? ? ? escape(acc) ? ? ? ? ? ? } else { ? ? ? ? ? ? ? ? .tailr_n <- n - 1 ? ? ? ? ? ? ? ? .tailr_acc <- n * acc ? ? ? ? ? ? ? ? n <- .tailr_n ? ? ? ? ? ? ? ? acc <- .tailr_acc ? ? ? ? ? ? } ? ? ? ? } ? ? }) } factorial_tr_automatic_2 <- function(n, acc = 1) { ? ? .tailr_env <- rlang::get_env() ? ? callCC(function(escape) { ? ? ? ? repeat { ? ? ? ? ? ? if (n <= 1) { ? ? ? ? ? ? ? ? escape(acc) ? ? ? ? ? ? } else { ? ? ? ? ? ? ? ? .tailr_env$.tailr_n <- n - 1 ? ? ? ? ? ? ? ? .tailr_env$.tailr_acc <- n * acc ? ? ? ? ? ? ? ? .tailr_env$n <- .tailr_env$.tailr_n ? ? ? ?...
2018 Feb 11
0
Parallel assignments and goto
...ariables so the expression uses the old variable values and not the new values until the assignments are all done ? and one related to restarting a loop from nested loops or from nested expressions in `with` expressions or similar. > > I can implement parallel assignment using something like rlang::env_bind: > > factorial_tr_2 <- function (n, acc = 1) > { > .tailr_env <- rlang::get_env() > repeat { > if (n <= 1) > return(acc) > else { > rlang::env_bind(.tailr_env, n = n - 1, acc = acc * n) > next &...
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
2019 Nov 11
2
R en Jupyter Lab, error al cargar dplyr: "namespace 'rlang' 0.3.4 is being loaded, but >= 0.4.0 is required"
...9] uuid_0.1-2 IRkernel_0.8.15 jsonlite_1.6 digest_0.6.18 [13] repr_0.19.2 evaluate_0.13 Cuando solicito la librería dplyr: library(dplyr) Error: package or namespace load failed for 'dplyr' in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]): namespace 'rlang' 0.3.4 is being loaded, but >= 0.4.0 is required Traceback: 1. library(dplyr) 2. tryCatch({ . attr(package, "LibPath") <- which.lib.loc . ns <- loadNamespace(package, lib.loc) . env <- attachNamespace(ns, pos = pos, deps, exclude, include.only) . }, error...
2018 Feb 27
0
Parallel assignments and goto
...{ > escape(acc) > } else { > .tailr_n <<- n - 1 > .tailr_acc <<- n * acc > } > } > }) > } > > factorial_tr_automatic_2 <- function(n, acc = 1) { > .tailr_env <- rlang::get_env() > callCC(function(escape) { > repeat { > if (n <= 1) { > escape(acc) > } else { > .tailr_env$.tailr_n <- n - 1 > .tailr_env$.tailr_acc <- n * acc > .tailr_...
2019 Jul 23
2
quiet namespace load is noisy
Dear R-devel, Consider the following clip (in R version 3.6.0, Windows): > requireNamespace("ggplot2", quietly = TRUE) Registered S3 methods overwritten by 'ggplot2': method from [.quosures rlang c.quosures rlang print.quosures rlang It seems to me that if one specifies 'quietly = TRUE', then messages about S3 method overrides should be quieted along with everything else. After all, other package startup messages ARE suppressed, and even error messages are suppresse...
2020 May 11
4
library ggplot2, swirl, car, lattice. No consigo abrir bibliotecas
...do >library("ggplot2") una vez instalados packages en el R-Studio. El programa me reporta lo siguiente: Error: package or namespace load failed for ?ggplot2? in get(Info[i, 1], envir = env): no fue posible abrir el archivo 'C:/Users/David Menchén/Documents/R/win-library/4.0/rlang/R/rlang.rdb': No such file or directory Gracias
2019 Jul 23
2
[External] Re: quiet namespace load is noisy
...thing that the user can act upon, the developers > of the parties involved need to be contacted by users so they can > fix it (the developers of the conflicting methods might not be > aware if the generic is from a third party package, such as > base::print()). In the case of ggplot2 vs rlang, you can update > ggplot2 to the latest version to fix these messages. > >> After all, other package startup messages ARE suppressed, and >> even error messages are suppressed > > Note that `quietly = TRUE` does not really suppress error > messages for missing packages....
2020 Mar 17
0
new bquote feature splice does not address a common LISP @ use case?
...and 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 https://github.com/r-lib/rlang/blob/master/src/internal/expr-interp-rotate.c). Maybe it could be possible to formulate a definition where splicing in special calls like binary operators produces the same AST as the user would type by hand. It seems this would make splicing easier to use for end users, but make the metaprogrammin...
2018 Feb 14
0
Parallel assignments and goto
...expression uses the old variable values and not > the new values until the assignments are all done ? and one related to > restarting a loop from nested loops or from nested expressions in `with` > expressions or similar. > > I can implement parallel assignment using something like rlang::env_bind: > > factorial_tr_2 <- function (n, acc = 1) { > .tailr_env <- rlang::get_env() > repeat { > if (n <= 1) > return(acc) > else { > rlang::env_bind(.tailr_env, n = n - 1, acc = acc * n) > next &...
2008 Nov 13
2
How to fix broken ogg/theora files
...we edit the original file with oggCut and then use oggz-validate we >> get an error message like the one posted before. Now oggz-sort will fix >> the file so oggz-validate doesn't find any errors. However ffmpeg still >> produces and error with it: >> >> ffmpeg -i rlang.ogg -ab 56 -ar 22050 -acodec libmp3lame rlang.flv >> >> ... >> >> This is the same error we had before fixing the file with oggz-sort >> Any other suggestions? > > that's very interesting, can you please post a URL to the files? > Thanks for your help....
2019 Jul 23
2
[External] Re: quiet namespace load is noisy
...e developers > >> of the parties involved need to be contacted by users so they can > >> fix it (the developers of the conflicting methods might not be > >> aware if the generic is from a third party package, such as > >> base::print()). In the case of ggplot2 vs rlang, you can update > >> ggplot2 to the latest version to fix these messages. > >> > >>> After all, other package startup messages ARE suppressed, and > >>> even error messages are suppressed > >> > >> Note that `quietly = TRUE` does not reall...
2024 Feb 17
2
Capturing Function Arguments
...n sourced scripts as part of a unit testing framework. I can capture the values fine, but I'm having trouble evaluating them as if `force()` had been applied to each of them. Here is a minimal example: f0 <- function(x, y = 2 * z, z, a = NULL, b) NULL f <- function(...) { call <- rlang::call_match(fn = f0, defaults = TRUE) args <- rlang::call_args(call) # do something here to evaluate args as if force() had been called # I've tried many things but haven't found a solution that handled everything args } # In the below example args1 and args2 should be the same...
2008 Nov 13
2
How to fix broken ogg/theora files
...fortunately it did not help completely. When we edit the original file with oggCut and then use oggz-validate we get an error message like the one posted before. Now oggz-sort will fix the file so oggz-validate doesn't find any errors. However ffmpeg still produces and error with it: ffmpeg -i rlang.ogg -ab 56 -ar 22050 -acodec libmp3lame rlang.flv [vorbis @ 0x880dbb0]Not a Vorbis I audio packet. [vorbis @ 0x880dbb0]Not a Vorbis I audio packet. [vorbis @ 0x880dbb0]Not a Vorbis I audio packet. [theora @ 0x87fd4f0]Header packet passed to frame decoder, skipping Error while decoding stream #0.0...
2017 Aug 14
0
tidyverse repeating error: "object 'rlang_mut_env_parent' not found"
The most likely explanation is you have a new version of dplyr/tibble and an old version of rlang. Try re-installing rlang. Hadley On Mon, Aug 14, 2017 at 9:26 AM, Szumiloski, John <John.Szumiloski at bms.com> wrote: > UseRs, > > When doing some data manipulations using the tidyverse, I am repeatedly getting the same error message in now three separate situations. I can write...
2019 Jul 23
0
quiet namespace load is noisy
...s. This is not something that the user can act upon, the developers of the parties involved need to be contacted by users so they can fix it (the developers of the conflicting methods might not be aware if the generic is from a third party package, such as base::print()). In the case of ggplot2 vs rlang, you can update ggplot2 to the latest version to fix these messages. > After all, other package startup messages ARE suppressed, and > even error messages are suppressed Note that `quietly = TRUE` does not really suppress error messages for missing packages. The errors are converted to a bo...
2018 Feb 21
1
deparseDots to get names of all arguments?
...t; > names(list(...)) > > do what you want? No, that does what he asked for, not what he wants :-). Spencer, you want to deparse all of the expressions in ..., not their names. I think base R doesn't have a way to do this (but I may be wrong). You can do it using some the rlang package. For example, this seems to work: deparseDots <- function(...) { unname(sapply(rlang::exprs(...), deparse)) } Duncan Murdoch
2023 Mar 31
2
removeSource() vs. function literals
If you can afford a dependency on rlang, `rlang::zap_srcref()` deals with this. It's recursive over expression vectors, calls (including calls to `function` and their hidden srcref arg), and function objects. It's implemented in C for efficiency as we found it to be a bottleneck in some applications (IIRC caching). I'd be hap...