library(tidyverse)
myfun1 <- function(v1) {
data.frame(
ID = deparse(substitute(v1))
)
}
myfun1(v1 = model)
#> ID
#> 1 model
myfun2 <- function(v1) {
tibble(
ID = deparse(substitute(v1))
)
}
myfun2(v1 = model)
#> # A tibble: 1 × 1
#> ID
#> <chr>
#> 1 v1
Created on 2023-08-30 with reprex v2.0.2
Why is this happening?