if (require("QCA")) {
# Cebotari & Vink (2013)
data(CVF)
# necessity relation between NATPRIDE and PROTEST
XYplot(CVF[, 5:6])
# same using two numeric vectors
XYplot(CVF$NATPRIDE, CVF$PROTEST)
# same using two column names
XYplot("NATPRIDE", "PROTEST", data = CVF)
# or using one string containing both
XYplot("NATPRIDE, PROTEST", data = CVF)
# since they are valid R statements, it works even without quotes
# (this only works in normal R console, not in the GUI version)
XYplot(NATPRIDE, PROTEST, data = CVF)
# negating the X axis, using numeric vectors
XYplot(1 - CVF$NATPRIDE, CVF$PROTEST)
# same thing using quotes
XYplot("1 - NATPRIDE, PROTEST", data = CVF)
# using tilde for negation
XYplot("~NATPRIDE, PROTEST", data = CVF)
# different color for the points
XYplot("~NATPRIDE, PROTEST", data = CVF, col = "blue")
# using a different character expansion for the axes
XYplot("~NATPRIDE, PROTEST", data = CVF, cex.axis = 0.9)
# custom axis labels
XYplot("~NATPRIDE, PROTEST", data = CVF, xlab = "Negation of NATPRIDE",
ylab = "Outcome: PROTEST")
# sufficiency relation
XYplot("~NATPRIDE, PROTEST", data = CVF, relation = "suf")
# jitter the points
XYplot("~NATPRIDE, PROTEST", data = CVF, jitter = TRUE)
# jitter with more amount
XYplot("~NATPRIDE, PROTEST", data = CVF, jitter = TRUE, amount = 0.02)
# adding labels to points
XYplot("~NATPRIDE, PROTEST", data = CVF, jitter = TRUE, cex = 0.8,
clabels = rownames(CVF))
# or just the row numbers, since the row names are too long
XYplot("~NATPRIDE, PROTEST", data = CVF, jitter = TRUE, cex = 0.8,
clabels = seq(nrow(CVF)))
}
Run the code above in your browser using DataLab