wpie: wpie

Description Usage Arguments Examples

View source: R/MarkdownReportsDev.R

Description

Create and save pie charts 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.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
wpie(
  NamedVector,
  percentage = TRUE,
  both_pc_and_value = FALSE,
  plotname = substitute(NamedVector),
  col = gplots::rich.colors(length(NamedVector)),
  savefile = unless.specified("b.save.wplots"),
  w = unless.specified("b.defSize", 7),
  h = w,
  mdlink = ww.set.mdlink(),
  PNG = unless.specified("b.usepng", F),
  ...
)

Arguments

NamedVector

The variable to plot.

percentage

Display percentage instead of counts. TRUE by default.

both_pc_and_value

Report both percentage AND number.

plotname

Title of the plot (main parameter) and also the name of the file.

col

Fill color. Defined by rich colours by default

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.

...

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

Examples

1
2
Cake = 1:3; names(Cake) = letters[1:3]; wpie (Cake, percentage = TRUE,
w = 7, mdlink = FALSE)

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