# 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
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)
# same thing without quotes, 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
pos <- XYplot(~NATPRIDE, PROTEST, data = CVF, jitter = TRUE)
text(pos$x + 0.02, pos$y + 0.02, labels = rownames(CVF), cex = 0.8)
# or just the row numbers, since the labels are very long
pos <- XYplot(~NATPRIDE, PROTEST, data = CVF, jitter = TRUE)
text(pos$x + 0.02, pos$y + 0.02, cex = 0.8)Run the code above in your browser using DataLab