languageserver icon indicating copy to clipboard operation
languageserver copied to clipboard

Incorrect `variable assigned but may not be used` warning

Open carschandler opened this issue 1 year ago • 0 comments

With the following minimal-ish code snippet, I'm getting a warning that model was assigned but may not be used:

boot_wls <- function(data, indices) {
  data <- data[indices, ]
  model <- lm(y ~ x1 + x2 + x3, data)
  w <- 1 / fitted(lm(abs(residuals(model)) ~ x1 + x2 + x3, data))^2
  w
}

carschandler avatar Jul 20 '24 04:07 carschandler