c19_inkmagick: Produce high-quality PNG & JPEG (along with SVG).

Description Usage Arguments Details See Also Examples

View source: R/c19_inkmagick.R

Description

Production quality output using Inkscape for rasterization & ImageMagick for JPEG compression. (SVG output is the same quality as other functions.)

Usage

1
2
3
4
5
6
7
8
c19_inkmagick(
  var = TRUE,
  eu = TRUE,
  r = TRUE,
  d_all = FALSE,
  dl = TRUE,
  rl = TRUE
)

Arguments

var

whether to output various data.egov.bg-sourced plots

eu

whether to output EUROSTAT/ECDC-sourced plots

r

whether to plot r (incl. time-consuming calculation)

d_all

whether to plot age band death plots for countries other than BG

dl

whether to refresh all data sets from the Internet

rl

whether to refresh all data sets from disk

Details

Using these programs yields slightly better results but is not really necessary. c19_save_all() saves SVG of the same quality but produces lower-quality PNG/JPEG. You can also save individual plots using ggplot2::ggsave() or plot to screen (e.g. c19_heat() or print(c19_heat()) in non-interactive mode).

Output files will be stored in folders c19bg/plots/MMMDD (month-day). Downloaded and calculated data will be stored in c19bg/data.

Paths to Inkscape and ImageMagick can be set via options.

See Also

Other output funcs: c19_eu_plots_save(), c19_heat_save(), c19_oblasts_save(), c19_r_plot_save(), c19_save_all(), c19_var_plot_save()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## Not run: 
# set options
options(c19bg.output = list(
  inkscape = "\"C:\\Program Files\\Inkscape\\bin\\inkscape.exe\"",
  inkopts = "-w %d --export-filename",
  magick = "magick",  # works, if it's in PATH
  mgkopts = "-quality 100",
  pixwidth = 1375,
  width = 11,
  height = 7,
))
options(c19bg.output_dir = "c19bg/plots")

# standard run (download from Internet)
c19_inkmagick()

# include country-level age band plots from EUROSTAT demo mortality database
c19_inkmagick(d_all = T)

# don't download datasets already present in data dir
c19_inkmagick(dl = F)

## End(Not run)

StanTraykov/c19bg documentation built on Nov. 2, 2021, 4:46 a.m.