Learn R Programming

simplevis (version 4.0.0)

sv_x_zero_adjust: Automatically adjust x_zero and x_zero_line if necessary

Description

Automatically adjust x_zero and x_zero_line if necessary

Usage

sv_x_zero_adjust(x_var_vctr, x_balance, x_zero, x_zero_line)

Arguments

x_var_vctr

A vector of values for the x scale.

x_balance

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

x_zero

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

x_zero_line

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

description

Generate a list of x_zero and x_zero_line elements that are adjusted if necessary.

Value

A list with first element x_zero (TRUE or FALSE) and second element x_zero_line (TRUE or FALSE)