Skip to contents

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)
#> [1] "+0.301" "+0.602" "+0.903" "+1.2"   "+1.51" 
FC_format(0, 2)(c(1/4, 1/2, 1,2,4,8))
#> [1] "-2" "-1" "+0" "+1" "+2" "+3"
FC_format(10, 0)(-1:3)
#> [1] "1/10" "1"    "10"   "100"  "1000"
FC_format(0, 10)(c(0.1, 1, 10, 100, 100))
#> [1] "-1" "+0" "+1" "+2" "+2"