Skip to contents

Converts all columns in a data.frame to use the same system of units

Usage

standardize_units(
  data,
  .cols = tidyselect::eval_select(is.numeric, data),
  Units = NULL
)

Arguments

data

A data.frame

.cols

The columns from which the Units are converted (by default, all numeric).

Units

Character of the units of measurement (e.g. "m" or "ft") or default NULL

Value

Data.frame with all columns in .cols (by default, all numeric columns) converted to use the units defined in Units