From 0cd9f8065e1733fc0a7c858cedaae4248acbed7c Mon Sep 17 00:00:00 2001 From: Hanne Oberman Date: Fri, 19 Jan 2024 16:41:25 +0100 Subject: [PATCH] Add `stats` namespace to `coef()` --- R/get.df.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/get.df.R b/R/get.df.R index 5dd65640b..18eceefa4 100644 --- a/R/get.df.R +++ b/R/get.df.R @@ -14,14 +14,14 @@ get.dfcom <- function(model, dfcom = NULL) { # coxph model: nevent - p if (inherits(model, "coxph")) { - return(as.numeric(max(model$nevent - length(coef(model)), 1))) + return(as.numeric(max(model$nevent - length(stats::coef(model)), 1))) } # other model: n - p nobs <- tryCatch(length(stats::residuals(model)), error = function(e) NULL) if (!is.null(nobs)) { - return(as.numeric(max(nobs - length(coef(model)), 1))) + return(as.numeric(max(nobs - length(stats::coef(model)), 1))) } # nothing found