labels_SPSS: Format axis tick labels similar to SPSS

labels_SPSSR Documentation

Format axis tick labels similar to SPSS

Description

Format axis tick labels in a similar manner to SPSS to mimic the look of SPSS graphs.

Usage

number_SPSS(x, big.mark = "", ...)

numberSPSS(x, big.mark = "", ...)

substr_SPSS(x, start = 1, stop = 8)

substrSPSS(x, start = 1, stop = 8)

Arguments

x

for number_SPSS, a numeric vector to format. For substr_SPSS, a vector of character strings to be cut.

big.mark

a character string to be inserted every 3 digits to separate thousands. The default is an empty string for no separation.

...

additional arguments to be passed to number.

start, stop

integers giving the first and last character to remain in the cut string, respectively. The default is to cut strings to the first 8 characters.

Details

number_SPSS is a wrapper for number that by default does not put a separator every 3 digits so separate thousands. It mainly exists to prevent scientific notation in axis tick labels, hence it is typically supplied as the labels argument of scale_x_continuous or scale_y_continuous.

substr_SPSS is a wrapper for substr to cut character strings by default to the first 8 characters, which is SPSS behavior for the tick labels of a discrete axis in some (but not all) plots. It is typically supplied as the labels argument of scale_x_discrete or scale_y_discrete.

Value

A character vector of the same length as x


r2spss documentation built on May 25, 2022, 5:05 p.m.