whist: whist

Description Usage Arguments Examples

View source: R/MarkdownReportsDev.R

Description

Create and save histograms 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. Name the file by naming the variable! Cannot be used with dynamically called variables e.g. call vectors within a loop. "filtercol" assumes >= coloring!

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
whist(
  variable,
  ...,
  breaks = 20,
  col = unless.specified("b.def.color", "gold1"),
  plotname = substitute(variable),
  main = kollapse("Histogram of ", substitute(variable)),
  xlab = substitute(variable),
  lty = 2,
  lwd = 3,
  lcol = 1,
  filtercol = 0,
  vline = FALSE,
  filter = c(FALSE, "HighPass", "LowPass", "MidPass")[1],
  passequal = TRUE,
  savefile = unless.specified("b.save.wplots"),
  w = unless.specified("b.defSize", 7),
  h = w,
  mdlink = ww.set.mdlink(),
  PNG = unless.specified("b.usepng")
)

Arguments

variable

The variable to plot.

...

Pass any other parameter of the corresponding plotting function(most of them should work).

breaks

Number of bins.

col

Color of the plot.

plotname

The name of the file.

main

Title of the plot.

xlab

X-axis label.

lty

Linetype, defined by numbers 1-6.

lwd

Line width. Set to 2 by default.

lcol

Color of the line.

filtercol

Color bars below / above the threshold with red / green. Define the direction by -1 or 1. Takes effect if "vline" is defined.

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.

filter

filtervalues

passequal

Pass equal values

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.

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.

Examples

1
2
3
MyGauss = rnorm(1000); whist (variable = MyGauss, col = "gold1", w = 7,
breaks = 20, mdlink = FALSE, hline = FALSE, vline = FALSE, lty = 2, lwd = 3,
lcol = 2, filtercol = 0)

vertesy/MarkdownReportsDev documentation built on Nov. 15, 2021, 9:59 a.m.