Learn R Programming

⚠️There's a newer version (1.0-1) of this package.Take me there.

units (version 0.4-6)

Measurement Units for R Vectors

Description

Support for measurement units in R vectors, matrices and arrays: automatic propagation, conversion, derivation and simplification of units; raising errors in case of unit incompatibility. Compatible with the POSIXct, Date and difftime classes. Uses the UNIDATA udunits library and unit database for unit compatibility checking and conversion.

Copy Link

Version

Install

install.packages('units')

Monthly Downloads

367,582

Version

0.4-6

License

GPL-2

Issues

Pull Requests

Stars

Forks

Maintainer

Edzer Pebesma

Last Published

August 27th, 2017

Functions in units (0.4-6)

make_unit

Create a new unit from a unit name.
parse_unit

parse unit in product power form (e.g. km m-2 s-1)
units

Set measurement units on a numeric vector
units_options

set one or more units global options
install_conversion_constant

Install a function for conversion between user-defined units.
install_conversion_function

Install a function for conversion between user-defined units.
plot.units

create axis label with appropriate labels
type_sum.units

type_sum for tidy tibble printing
Math.units

Mathematical operations for units objects
Ops.units

S3 Ops Group Generic Functions for units objects
deparse_unit

deparse unit to string in product power form (e.g. km m-2 s-1)
hist.units

histogram for unit objects
ud_units

List containing pre-defined units from the udunits2 package.
unitless

The "unit" type for vectors that are actually dimension-less.
as_difftime

convert units object into difftime object
as_units

convert object to a units object