modes: Get tcdkhelper mode

modesR Documentation

Get tcdkhelper mode

Description

set_mode() sets the mode of operation of tcdkhelper, mainly affecting relative paths interpreted by save_kpi().

Usage

get_mode()

set_mode(mode)

Arguments

mode

A string giving the mode of operation. When mode is omitted, a mode is set automatically. Currently supported values are "RStudio", "batch" and "compile".

Details

Currently, the following modes of operation is implemented in the save_kpi() function, and decide where (and if) a plot is saved:

"RStudio" saves to a subfolder of your current working directory called "KPI-PLOTS" (created if not already existing).

"batch" saves to the folder KPI-PLOTS on a network destination ("S-drive") shared within the TestCenter Danmark organisation.

"compile" does not save the file at all. This is useful if you have manually opened a graphics device (e.g. by pdf() and wish to print the plot to given device.

When set_mode() is called with no mode argument, a mode is decided as follows: If save_kpi() is called within RStudio, the mode "RStudio" is set. If not, and a graphics device - other than the "null device" - is set, mode is set to "compile". This mode generates no output, allowing for manually printing plots to set device, minimizing the risk of duplicate plots in your destination. Finally, if run outside RStudio with no graphics device, "batch" mode is set.

Value

A string giving the current (or new) tcdkhelper mode.


Testcenter-Danmark/tcdkhelper documentation built on March 18, 2022, 2:19 p.m.