search for: dots2

Displaying 8 results from an estimated 8 matches for "dots2".

Did you mean: dots
2018 Aug 13
1
substitute() on arguments in ellipsis ("dot dot dot")?
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", rnorm(3), stop("bang!")), dots2(1+2, "a", rnorm(3), stop("bang!"...
2018 Aug 13
2
substitute() on arguments in ellipsis ("dot dot dot")?
Interestingly, as.list(substitute(...())) also works. On Sun, Aug 12, 2018 at 1:16 PM, Duncan Murdoch <murdoch.duncan at gmail.com> 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) list(a = substitute(a), b =
2018 Aug 13
0
substitute() on arguments in ellipsis ("dot dot dot")?
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(...())) dots3 <- function(...) match.call(expa...
2020 Oct 06
0
understanding as.list(substitute(...()))
...understand what substitute() does -- see ?substitute and/or a tutorial on "R computing on the language" or similar. Here is a simple example that may clarify: > dots <- function(...) as.list(substitute(...())) > dots(log(foo)) [[1]] log(foo) ## a call, a language object > dots2 <- function(...) as.list(...) > dots2(log(foo)) Error in as.list(...) : object 'foo' not found ## substitute() does not evaluate its argument; as.list() does Cheers, Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it.&...
2020 Oct 05
2
understanding as.list(substitute(...()))
Could someone explain what is happening with the ...() of the following function: dots <- function(...) as.list(substitute(...())) I understand what I'm getting as a result but not why. ?dots and ?substitute leave me none the wiser. regards Tim
2020 Oct 06
3
understanding as.list(substitute(...()))
...?substitute and/or a tutorial on "R computing on the language" or similar. > > Here is a simple example that may clarify: > > > dots <- function(...) as.list(substitute(...())) > > dots(log(foo)) > [[1]] > log(foo) ## a call, a language object > > > dots2 <- function(...) as.list(...) > > dots2(log(foo)) > Error in as.list(...) : object 'foo' not found > ## substitute() does not evaluate its argument; as.list() does > > Cheers, > Bert Gunter > > "The trouble with having an open mind is that people keep comi...
2020 Oct 06
0
understanding as.list(substitute(...()))
..."R computing on the language" or similar. >> >> Here is a simple example that may clarify: >> >>> dots <- function(...) as.list(substitute(...())) >>> dots(log(foo)) >> [[1]] >> log(foo) ## a call, a language object >> >>> dots2 <- function(...) as.list(...) >>> dots2(log(foo)) >> Error in as.list(...) : object 'foo' not found >> ## substitute() does not evaluate its argument; as.list() does >> >> Cheers, >> Bert Gunter >> >> "The trouble with having an ope...
2009 Dec 07
3
savePlot for Mac and / or Linux?
Hi all, In the package rtlu, I use the function savePlot. It is convenient since it let the user decide in which graphic format he wants his graph to be export. But when I run R CMD check, I get the following message : > rtlu(V1,fileOutput="First.tex",textBefore="\\section{Variable 1 to 3}",graphName="V1") Error in savePlot(filename = nomBarplot, type = type)