FC_format: Formatter for fold change tick labels

View source: R/scale-continuous-logFC.r

FC_formatR Documentation

Formatter for fold change tick labels

Description

Generate tick labels discounting a log transformation in data, and optionally applying a different log transformation or no transformation.

Usage

FC_format(log.base.data = 2, log.base.labels = 10, digits = 3, ...)

FC_plain(
  x,
  log.base.data = 2,
  log.base.labels = 10,
  digits = 3,
  fmt = "%+.*g",
  ...
)

Arguments

log.base.data

of data.

log.base.labels

of labels.

digits

number of significant digits to show.

...

other arguments passed on to format.

x

a numeric vector to format.

fmt

character string containing the format for one number using * for the precision.

Value

a function with single parameter x, a numeric vector, that returns a character vector.

See Also

Other Functions for quadrant and volcano plots: outcome2factor(), scale_colour_outcome(), scale_shape_outcome(), scale_y_Pvalue(), xy_outcomes2factor()

Examples


FC_format(2, 10)(1:5)
FC_format(0, 2)(c(1/4, 1/2, 1,2,4,8))
FC_format(10, 0)(-1:3)
FC_format(0, 10)(c(0.1, 1, 10, 100, 100))


ggpmisc documentation built on Nov. 16, 2023, 5:10 p.m.