Learn R Programming

expirest (version 0.1.6)

print_val: Print value(s)

Description

The function print_val() generates a character string for the purpose to print a value on a plot (together with associated information).

Usage

print_val(val_name, val_value, val_unit, val_sf, prefix = "", suffix = "")

Value

A single character string of the form “val_name: val_value (with the number of specified decimal places) val_unit”.

Arguments

val_name

A character string that specifies the text preceding the value of the parameter to be displayed.

val_value

A numeric value that specifies the value of the parameter to be displayed.

val_unit

A character string that specifies the text following the value of the parameter to be displayed.

val_sf

A positive integer that specifies the number of significant figures for the display of the limit.

prefix

A character string at the beginning of the whole text. The default is an empty string, i.e. "".

suffix

A character string at the end of the whole text. The default is an empty string, i.e. "".

Details

The function print_val() generates a character string that is based on the provided information. The string is used as label of a corresponding graph element. For the number formatting, the sprintf() function from the ‘base’ package is used. For concatenation of the various elements, the paste() function from the ‘base’ package is used.

See Also

get_text_annotation, get_n_whole_part, formatC, paste.