regcom {rreg} | R Documentation |
Create a barplot with point to visualise comparison. It is also possible to include table to show the value of the plot.
regcom(data, x, yl, yc, tab = TRUE, title, scale, ascending = TRUE, col1, col2, lab1, lab2, num, rotate, leg1, leg2, ...)
data |
Data set |
x |
x-axis |
yl |
Variable or column for local values |
yc |
Variable or column for national values |
tab |
Include table |
title |
Title for the plot |
scale |
Scale for x-axis ie. percentage or number |
ascending |
Sort data ascending order |
col1 |
Color for bars |
col2 |
Color for the 'diff' bar |
lab1 |
Label for table first column |
lab2 |
Label for table second column |
num |
Include denominator i.e N in the figure eg. Tawau HF (N=2088) |
rotate |
Rotate table text |
leg1 |
Text legend for bar |
leg2 |
Text legend for point |
... |
Additional arguments |
library("rreg") regcom(data = hfdata, x = inst, yl = case2, yc = case1) # include table regcom(data = hfdata, x = inst, yl = case2, yc = case1, tab = FALSE) # keep original order regcom(data = hfdata, x = inst, yl = case2, yc = case1, scale = "Percentage", ascending = FALSE) # text for table rotate 10% regcom(data = hfdata, x = inst, yl = case2, yc = case1, lab1="Tawau", lab2="Negara", rotate=10)