Description Usage Arguments Examples
View source: R/MarkdownReportsDev.R
Create and save bar plots as .pdf, in "OutDir". If mdlink = TRUE, it inserts a .pdf and a .png link in the markdown report, set by "path_of_report". The .png version is not created, only the link is put in place, not to overwrite previous versions.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | wbarplot(
variable,
...,
col = unless.specified("b.def.colors", "gold1"),
sub = FALSE,
plotname = substitute(variable),
main = plotname,
tilted_text = FALSE,
ylim = NULL,
hline = FALSE,
vline = FALSE,
filtercol = 1,
lty = 1,
lwd = 2,
lcol = 2,
errorbar = FALSE,
upper = 0,
lower = upper,
arrow_width = 0.1,
arrow_lwd = 1,
savefile = unless.specified("b.save.wplots"),
w = unless.specified("b.defSize", 7),
h = w,
incrBottMarginBy = 0,
mdlink = ww.set.mdlink(),
PNG = unless.specified("b.usepng", F)
)
|
variable |
The variable to plot. |
... |
Pass any other parameter of the corresponding plotting function(most of them should work). |
col |
Color of the plot. |
sub |
Subtitle below the plot. |
plotname |
The name of the file saved. |
main |
The title of the plot. |
tilted_text |
Use 45 degree x-labels if TRUE. Useful for long, but not too many labels. |
ylim |
Defines the Y axis range. Replacement for the standard "ylim" argument. |
hline |
Draw a horizontal line at the value you pass on to it. Useful to display a threshold. Design the line by "lty", "lwd" & "lcol" parameters. |
vline |
Draw a vertical line at the value you pass on to it. Useful to display a threshold. Design the line by "lty", "lwd" & "lcol" parameters. |
filtercol |
Color bars below / above the threshold with red / green. Define the direction by -1 or 1. Takes effect if "hline" is defined. |
lty |
Linetype, defined by numbers 1-6. |
lwd |
Linewidth. Set to 2 by default. |
lcol |
Color of the line. |
errorbar |
Draw error bars if TRUE. Pass on the value in parameters "upper" and "lower". Refine the look by "w" and "arrow_lwd". |
upper |
Size of the upper error bar. |
lower |
Size of the lower error bar. By default, it equals the upper error bar. |
arrow_width |
Width of the arrow head. |
arrow_lwd |
Line width for the error bars. |
savefile |
Save plot as pdf in OutDir, TRUE by default. |
w |
Width of the saved pdf image, in inches. |
h |
Height of the saved pdf image, in inches. |
incrBottMarginBy |
Increase the blank space at the bottom of the plot. Use if labels do not fit on the plot. |
mdlink |
Insert a .pdf and a .png image link in the markdown report, set by "path_of_report". |
PNG |
Set to true if you want to save the plot as PNG instead of the default PDF. |
1 2 3 4 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.