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
; >>> 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
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
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
4 matches
Mail list logo