regcom: Barplot with point and table for comparison

Description Usage Arguments Examples

Description

Create a barplot with point to visualise comparison. It is also possible to include table to show the value of the plot.

Usage

1
2
regcom(data, x, yl, yc, tab = TRUE, title, scale, ascending = TRUE, col1,
  col2, lab1, lab2, num, rotate, leg1, leg2, ...)

Arguments

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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)

rreg documentation built on May 2, 2019, 9:58 a.m.

Related to regcom in rreg...