-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
Right now plot.xbal has a lot of issues (see eg #82 #80 and another unreported issue that vertical margins look wonky). Have we considered moving to ggplot2 instead of base R plotting? It would address a lot of the concerns immediately. We can get 90% of the way there very quickly:
library(optmatch)
library(RItools)
data(nuclearplants)
fm <- fullmatch(pr ~ ., data = nuclearplants)
bal <- xBalance(pr ~ . + strata(fm), data = nuclearplants)
x <- as.data.frame(RItools:::prepareXbalForPlot(bal))
library(tidyverse)
x <- rownames_to_column(x)
x <- gather(x, strata, values, -rowname)
# x<- mutate(values = abs(values)) # enable for `abs = TRUE`.
ggplot(x, aes(y = rowname, x = values, color = strata, shape = strata)) +
geom_vline(xintercept = 0) +
geom_point() +
theme(legend.position = "bottom")
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
