search for: rlang

Displaying 14 results from an estimated 14 matches for "rlang".

Did you mean: clang
2018 Feb 11
2
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 26
1
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
1
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 &...
2018 Feb 27
1
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 27
1
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_...
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 &...
2017 Aug 14
1
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...
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
2018 Feb 20
2
deparseDots to get names of all arguments?
On 21/02/18 11:36, Spencer Graves wrote: > Hi, All: > > > ????? How can I get the names of all the arguments in dots(...)? > > > ????? I'm able to get the name of the first argument but not the second: > > > > deparseDots <- function(...){ > ? deparse(substitute(...)) > } > a <- 1 > b <- 2 > deparseDots(a, b) > [1]
2017 Sep 07
2
withr::set_makevars
...gt; R6 2.2.2 2017-06-17 CRAN (R 3.4.0) > rcmdcheck 1.2.1 2016-09-28 CRAN (R 3.4.0) > Rcpp 0.12.12 2017-07-15 CRAN (R 3.4.1) > remotes 1.1.0 2017-07-09 CRAN (R 3.4.1) > rex 1.1.1 2016-12-05 CRAN (R 3.4.0) > rlang 0.1.2.9000 2017-09-05 Github (tidyverse/rlang at fd64bce) > rprojroot 1.2 2017-01-16 CRAN (R 3.4.0) > rstudioapi 0.6.0.9000 2017-08-31 Github (rstudio/rstudioapi at e1e466b) > sessioninfo 1.0.1 2017-08-31 Github (r-lib/sessioninfo at e813...
2017 Sep 06
1
withr::set_makevars
...2016-09-28 CRAN (R 3.4.0) Rcpp 0.12.12 2017-07-15 CRAN (R 3.4.1) remotes 1.1.0 2017-07-09 CRAN (R 3.4.1) rex 1.1.1 2016-12-05 CRAN (R 3.4.0) rlang 0.1.2.9000 2017-09-05 Github (tidyverse/rlang at fd64bce) rprojroot 1.2 2017-01-16 CRAN (R 3.4.0) rstudioapi 0.6.0.9000 2017-08-31 Github (rstudio/rstudioapi at e1e466b) sessioninfo 1.0.1 2017-08-31 Github (r-...
2017 Aug 14
2
tidyverse repeating error: "object 'rlang_mut_env_parent' not found"
...edly getting the same error message in now three separate situations. I can write up a reproducible example, but want to lay out the high-level issues in case someone recognizes exactly what is happening here. The error is: Error in mut_env_parent(overscope$.top_env, lexical_env) : object 'rlang_mut_env_parent' not found and it occurs in three situations: 1) Using tidyr::nest() on an output from dplyr::group_by() 2) Using tibble::tibble() with <name> = <value> arguments 3) Using dplyr::select() on a tibble to select two columns Any obvious clues as to w...
2018 May 30
2
Filtering using multiple rows in dplyr
Hi Folks, I have just started using dplyr and could use some help getting unstuck. It could well be that dplyr is not the package to be using, but let me just pose the question and seek your advice. Here is my basic data frame. head(h) subject ageGrp ear hearingGrp sex freq L2 Ldp Phidp NF SNR 1 HALAF032 A L A F 2 0 -23.54459 55.56005 -43.08282
2018 May 03
1
The stages of standard function evaluation
Dear R Help folks -- I have been trying to put together a list of the steps or stages of R function evaluation, with particular focus on those that have "standard" or "nonstandard" forms. This is both for my own edification and also because I am thinking of joining the world of R bloggers and have been trying to put together some draft posting that might be useful. I seem to