fixed.pval: Format a p-value in fixed notation.

Description Usage Arguments Value Examples

View source: R/string.utilities.R

Description

This is a thin wrapper around format.pval() that guarantees fixed (not scientific) notation, links (by default) the eps argument to the digits argument and vice versa, and sets nsmall to equal digits.

Usage

1
2
3
4
5
6
7
fixed.pval(
  pv,
  digits = max(1, getOption("digits") - 2),
  eps = 10^-digits,
  na.form = "NA",
  ...
)

Arguments

pv, digits, eps, na.form, ...

see format.pval().

Value

A character vector.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
pvs <- 10^((0:-12)/2)

# Jointly:
fpf <- fixed.pval(pvs, digits = 3)
fpf
format.pval(pvs, digits = 3) # compare

# Individually:
fpf <- sapply(pvs, fixed.pval, digits = 3)
fpf
sapply(pvs, format.pval, digits = 3) # compare

# Control eps:
fpf <- sapply(pvs, fixed.pval, eps = 1e-3)
fpf

statnet.common documentation built on June 5, 2021, 5:06 p.m.