Learn R Programming

simplevis (version 3.0.0)

sv_y_zero_adjust: Automatically adjust y_zero and y_zero_line if necessary

Description

Automatically adjust y_zero and y_zero_line if necessary

Usage

sv_y_zero_adjust(y_var_vctr, y_balance, y_zero, y_zero_line)

Arguments

y_var_vctr

A vector of values for the y scale.

y_balance

Add balance to the y axis so that zero is in the centre of the y scale. Only applicable where facet_scales equals "fixed" or "free_y".

y_zero

TRUE or FALSE whether the minimum of the y scale is zero. Defaults to TRUE.

y_zero_line

TRUE or FALSE whether to add a zero reference line to the y axis. Defaults to NULL, which is TRUE if there are positive and negative values in y_var. Otherwise it is FALSE.

description

Generate a list of y_zero and y_zero_line elements that are adjusted if necessary.

Value

A list with first element y_zero (TRUE or FALSE) and second element y_zero_line (TRUE or FALSE)