I am a beginner in R. I got stumped writing a rmarkdown
report,using ggplot
, on a survey. Sample size is at present small. I got thinking - how can I best visualize answers, given that three answers are possible "Yes", "No", "Uncertain" and I want the readers to know at a glance that all three answers were possible, but some of options were not chosen. Below reproduces my current data for that question:
df.YesNoUncertain <- data.frame(
X = sample(c("Yes", "No"), 11, replace = TRUE, prob = c(.99,.001)),
Y = sample(c("Yes", "No"), 11, replace = TRUE, prob = c(.9,.2)),
stringsAsFactors = F
)
I thought of maybe pie charts, but then the answers which were not chosen ("Uncertain") were not shown. Maybe there are better ways to do this?