ngreifer / cobalt

Covariate Balance Tables and Plots - An R package for assessing covariate balance
https://ngreifer.github.io/cobalt/
73 stars 11 forks source link

Getting enviroment error, after updating r to 4.1.1, I started #56

Closed alnajar closed 3 years ago

alnajar commented 3 years ago

I started my issue somewhere else https://github.com/cran/cobalt/issues/2#issue-987388137

Using the example in CRAN https://www.rdocumentation.org/packages/cobalt/versions/4.3.0/topics/love.plot

Here is my code and error

library(WeightIt) library(WeightIt); data("lalonde", package = "cobalt") w.out1 <- weightit(treat ~ age + educ + race + married + nodegree + re74 + re75, data = lalonde) love.plot(w.out1, thresholds = c(m = .1), var.order = "unadjusted")

Error in as.environment(pos) : no item called "get(".S3MethodsTable.", envir = asNamespace(i))" on the search list In addition: Warning messages: 1: In get(".S3MethodsTable.", envir = asNamespace(i)) : restarting interrupted promise evaluation 2: In get(".S3MethodsTable.", envir = asNamespace(i)) : internal error -3 in R_decompress1 3: In ls(get(".S3MethodsTable.", envir = asNamespace(i)), pattern = name) : ‘get(".S3MethodsTable.", envir = asNamespace(i))’ converted to character string

I wonder how if there is a quick fix, thank you!

ngreifer commented 3 years ago

I have a feeling there is nothing I can do and this is a problem with your installation and not the package. But let's diagnose this. Does this error occur when using bal.plot() too? What about bal.tab()? What about other packages that use ggplot2 (e.g., does plot(summary(w.out1)) also produce the error?)? Have you tried restarting R or uninstalling and re-installing cobalt?

alnajar commented 3 years ago

Thank you @ngreifer, uninstalling the package, restarting my machine and reinstalling the package got it working. I appreciate your quick response and suggestion. Great package, I always appreciate such work that I depend on for everyday analysis