widebars | R Documentation |
Create a series of barplots by grouping factor.
widebars(
x,
y,
main = NULL,
sub = NULL,
foot = NULL,
note = NULL,
col = c("grey90", "grey30", "lightblue2", "dodgerblue2")
)
x |
vector of grouping values |
y |
numeric vector of data values |
main, sub |
main title and sub title for plot |
foot, note |
footnote (left-adjusted) and note (right) for plot |
col |
a vector of colors for elements of the form
|
op <- par(
oma = c(5,5,7,5), mar = c(5,0,3,.1), las = 1,
fg = 'transparent', bg = 'grey98'
)
widebars(
mtcars$gear, mtcars$mpg * sample(c(-1,1), 32, replace = TRUE),
main = 'Motor Trend car road tests', sub = 'Miles per gallon by gear',
foot = 'some footnote that is not important', note = 'blahblah'
)
par(
oma = c(5,5,7,5), mar = c(5,0,3,.1), las = 1,
fg = 'transparent', bg = 'grey98'
)
widebars(
x <- rep(2004:2015, each = 4), rnorm(48),
main = paste('Market value,', paste0(range(x), collapse = ' - ')),
sub = 'Percent change, quarterly',
foot = paste('Values current as of', format(Sys.time(), '%b %Y')),
note = 'github.com/raredd'
)
par(op)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.