Learn R Programming

tidyrstats (version 0.1.0)

neg_log: Negative Logarithm (Base 10 by Default)

Description

Computes the negative logarithm of a numeric input using base 10 by default.

Usage

neg_log(x, base = 10)

neglog(x, base = 10)

Value

A numeric vector of negative logarithmic values.

Arguments

x

A numeric vector. Values must be positive.

base

A numeric value specifying the base of the logarithm. Default is 10.

Details

This function returns the negative logarithm of `x`. By default, it uses base 10, but you can specify a different base using the `base` argument. Designed for quickly transforming p values for statistical analysis.

Examples

Run this code
pvals <- 10^runif(10, -15, -1)
neg_log(pvals)

Run the code above in your browser using DataLab