Description Usage Arguments Examples
View source: R/MarkdownReportsDev.R
Create and save scatter 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. The .png version is not created, only the link is put in place. You can add 2D error bars around the dots, or add lines (ablines) to your plot, by setting "abline" argument to = FALSE (no line, default), "h" (horizontal, further specified by a = y-offset), "v" (vertical, further specified by a = x-offset), "ab" (line with an angle, further specified by a = offset, b = slope).
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 28 29 30 | wplot(
df2col,
col = 1,
pch = 18,
...,
panel_first = grid(NULL),
plotname = substitute(df2col),
errorbar = FALSE,
upper = 0,
lower = upper,
left = 0,
right = left,
width.whisker = 0.1,
arrow_lwd = 1,
col_errorbar = 1,
ylim = FALSE,
xlim = FALSE,
abline = c(FALSE, "v", "h", "ab")[1],
a = FALSE,
b = FALSE,
lty = 1,
lwd = 1,
col_abline = 1,
equal.axes = FALSE,
savefile = unless.specified("b.save.wplots"),
mdlink = ww.set.mdlink(),
w = unless.specified("b.defSize", 7),
h = w,
PNG = unless.specified("b.usepng", F)
)
|
df2col |
Input data frame to be plotted_2columns |
col |
Color of the plot. |
pch |
Define the symbol for each data point. A number 0-25 or any string between ""-s. |
... |
Pass any other parameter of the corresponding plotting function(most of them should work). |
panel_first |
Draw a backround grid, if set to "grid(NULL)" |
plotname |
Title of the plot (main parameter) and also the name of the file. |
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. |
left |
Size of the left error bar. |
right |
Size of the right error bar. By default, it equals the left error bar. |
width.whisker |
Width of the error bar whisker. |
arrow_lwd |
Line width for the error bar arrow. Line width for the error bar arrow. |
col_errorbar |
Color of the error bar arrow. |
ylim |
manual Y-limits error bar |
xlim |
manual X-limits error bar |
abline |
Draw a line on the plot. Any value from: c( 'v', 'h', 'ab') for vertical, horizontal, and line with any slope. In each case you need to specify "a = ", specifying the X-position for vertical (v); the Y-position for horizontal (yh) lines and the intercept for lines with a slope (ab). In the latter case, 'b' specifes the slope. |
a |
X-offset for vertical lines, Y-offset for horizontal, and inclined lines. |
b |
Slope of an inclined line. |
lty |
Linetype, defined by numbers 1-6. |
lwd |
Line width. Set to 2 by default. |
col_abline |
Color of the line. |
equal.axes |
Span of axes is set to equal (maximum range in either X or Y). |
savefile |
Save plot as pdf in OutDir, TRUE by default. |
mdlink |
Insert a .pdf and a .png image link in the markdown report, set by "path_of_report". |
w |
Width of the saved pdf image, in inches. |
h |
Height of the saved pdf image, in inches. |
PNG |
Set to true if you want to save the plot as PNG instead of the default PDF. |
1 2 3 4 5 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.