Open rafaelglezm opened 7 months ago
Hi Rafael,
Unfortunately, I am not able to replicate this issue using these versions of the package. The updated version of cobalt
is on CRAN, so you should be able to install it from there.
To diagnose this issue, can you give me a minimally reproducible data example (e.g., using lalonde
), and when you get the error, please run traceback()
and include the output in your reply.
Hi Noah Thank you very much for your quick response and help. I have restarted R, re-installed Cobalt from CRAN (Version 4.5.4, Build Date: 2024-02-26), and now it works perfectly Best regards, Rafael
library(cobalt) data("lalonde", package = "cobalt")
w.out1 <- WeightIt::weightit( treat ~ age + educ + race + married + nodegree + re74 + re75, data = lalonde )
love.plot(w.out1, thresholds = c(m = .1), var.order = "unadjusted")
re-install cobalt didn't solve this error and I didn't find function "scale_override_call" in any source file of cobalt package.
@himawork it's code that exists in ggplot2
, so my only recommendation would be to reinstall that and try again. Unfortunately I cannot reproduce the error on my machine.
I also had this issue. I uninstalled ggplot2
and cobalt
then reinstalled them, and that fixed it.
I'm trying to produce a loveplot of a matchit object, but I get the following error "Error in scale_override_call(call) : could not find function "scale_override_call"
I'm using MacOS, R 4.3.2 and the last Cobalt GitHub version (cobalt_4.5.4), and ggplot2 3.5.0
The code is the following:
matching_obj <- matchit(y ~ a + b + c + d, data = dataset, method = "nearest", ratio = 2, caliper = 0.1) love.plot(matching_obj, binary = "std", sample.names = c("Unmatched", "Matched"), thresholds = c(m = .1), title = NULL)
Thanks in advance