[R] Formula compared to call within model call

2021-08-11 Thread Tim Taylor
Manipulating formulas within different models I notice the following: m1 <- lm(formula = hp ~ cyl, data = mtcars) m2 <- update(m1, formula. = hp ~ cyl) all.equal(m1, m2) #> [1] TRUE identical(m1, m2) #> [1] FALSE waldo::compare(m1, m2) #> `old$call[[2]]` is a call #> `new$call[[2]]` is an S3 objec

Re: [R] understanding as.list(substitute(...()))

2020-10-06 Thread Tim Taylor
; >>> 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 a

Re: [R] understanding as.list(substitute(...()))

2020-10-05 Thread Tim Taylor
an open mind is that people keep coming along and > sticking things into it." > -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) > > > On Mon, Oct 5, 2020 at 1:37 PM Tim Taylor > wrote: >> >> Could someone explain what is happenin

[R] understanding as.list(substitute(...()))

2020-10-05 Thread Tim Taylor
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 __ R