data <- mtcars
m <- lm(mpg ~ wt, data)
data <- mtcars[-c(1:10), ]
m_update <- update(m, . ~ . + disp)
nobs(m)
#> [1] 32
nobs(m_update)
#> [1] 22
# but i didn't want to change the data. all i updated
# was the formula
Created on 2024-04-15 with reprex v2.1.0