knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

mpformatr

Mpformatr is a collection of utilities that help to fulfill reporting and rounding conventions for empirical numbers. These numbers have their own error. This error, e.g., determines the digit which the number is rounded to dynamically. Some functions might not be very complicated, but I was tired of repeating myself.

Installation

You can install mpformatr from Github with:

devtools::install_github("tamaracha/mpformatr")

Example

# x is a measurement error
x <- 0.174385229
# get order of magnitude of x
# This takes 2 significant digits
oom(x)
# format x accordingly
mpformat(x)
# format some measured value according to x
mpformat(42, oom(x))


tamaracha/mpformatr documentation built on May 8, 2019, 3:14 a.m.