ChristopherLucas / MatchingFrontier

Optimal pruning for imbalance minimization in causal inference
18 stars 8 forks source link

MatchingFrontier::plotMeans() clashes with ggplot2 #29

Closed Joe-Hilgard closed 8 years ago

Joe-Hilgard commented 8 years ago

Having ggplot2 loaded in the session seems to lead to the following error message in plotMeans():

plotMeans(my.frontier) Error in title(...) : cannot coerce type 'closure' to vector of type 'character'

It is only a suggestion, but it would be helpful if the namespace could be rearranged so as not to conflict with ggplot2. It's a popular enough package that one might assume it will be loaded. I understand this may not be feasible, which is why it is just a suggestion.

ChristopherLucas commented 8 years ago

Thanks Joe, I just looked into this.

It looks like this is because ggplot2 defines ylab() as a function, even though it's an argument in plot(). I think that's bad practice but I've adjusted the package accordingly (given the popularity of the package, I agree that it's a good idea). If you install the latest version on github, this should work.

Thanks again for pointing this out. Please let us know if you have more questions/comments/suggestions!

Chris