# NOT RUN {
### V/S (no idea what this is: ?mtcars only mentions 'V/S' :-))
### and transmission (automatic vs manual)
ggProportionPlot(mtcars, items=c('vs', 'am'));
### Number of cylinders, by default comparing lowest value
### (4) to highest (8):
ggProportionPlot(mtcars, items=c('cyl'));
# }
# NOT RUN {
### Not running these to save time during package building/checking
### We can also compare 4 to 6:
ggProportionPlot(mtcars, items=c('cyl'),
hiCategory=6);
### Now compared to total records, instead of to
### highest value (hiCategory is ignored then)
ggProportionPlot(mtcars, items=c('cyl'),
compareHiToLo=FALSE);
### And for 6 cylinders:
ggProportionPlot(mtcars, items=c('cyl'),
loCategory=6, compareHiToLo=FALSE);
### And for 8 cylinders:
ggProportionPlot(mtcars, items=c('cyl'),
loCategory=8, compareHiToLo=FALSE);
### And for 8 cylinders with different labels
ggProportionPlot(mtcars, items=c('cyl'),
loCategory=8,
subQuestions='Cylinders',
leftAnchors="Eight",
rightAnchors="Four\nor\nsix",
compareHiToLo=FALSE);
### ... And showing the diamonds for the confidence intervals
ggProportionPlot(mtcars, items=c('cyl'),
loCategory=8,
subQuestions='Cylinders',
leftAnchors="Eight",
rightAnchors="Four\nor\nsix",
compareHiToLo=FALSE,
showDiamonds=TRUE);
# }
# NOT RUN {
### Using less steps for the confidence levels and changing
### the fill colours
ggProportionPlot(mtcars,
items=c('vs', 'am'),
showDiamonds = TRUE,
scale_fill = c("#B63679FF", "#FCFDBFFF"),
conf.steps=seq(from=0.0001, to=.9999, by=.2));
# }
Run the code above in your browser using DataLab