Measurement Units for R Vectors

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. Documentation about 'units' is provided in the paper by Pebesma, Mailund & Hiebert (2016, ), included in this package as a vignette; see 'citation("units")' for details.


Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("units")

1.0-1 by Edzer Pebesma, 7 months ago


https://r-quantities.github.io/units/, https://github.com/r-quantities/units


Report a bug at https://github.com/r-quantities/units/issues


Browse source code at https://github.com/cran/units


Authors: Edzer Pebesma [aut, cre] (ORCID: , Thomas Mailund [aut] , Tomasz Kalinowski [aut] , James Hiebert [ctb] , IƱaki Ucar [aut] , Thomas Lin Pedersen [ctb]


Documentation:   PDF Manual  


GPL-2 license


Imports Rcpp

Suggests NISTunits, measurements, xml2, magrittr, pillar, dplyr, vctrs, ggplot2, testthat, vdiffr, knitr, rvest, rmarkdown

Linking to Rcpp

System requirements: udunits-2


Imported by ARUtools, ECOTOXr, EmissV, FIESTAutils, ILORA, IceSat2R, MRG, MassWateR, MultiscaleSCP, PKbioanalysis, WISP.data, a5R, aNCA, clim4health, crsuggest, cvasi, damAOI, dci, divseg, divvy, duckspatial, eSDM, elevatr, epocakir, equil2, flowcluster, formatdown, fude, gasanalyzer, geonuts, geoprofiler, ggOceanMaps, greenR, gtfs2emis, gtfs2gps, gtfstools, gunit, hosm, hydraulics, hydrogeofetch, hydroloom, iNZightTools, intSDM, ir, jmastats, jpgrid, jpmesh, latbias, lwgeom, mapboxapi, mappingAS, medfate, mesonet, meteo, meteoland, meteospain, microinverterdata, move2, ndi, nhdR, nhdplusTools, nngeo, pacu, plantTracker, populR, prioritizr, rangeBuilder, raytracing, rcrisp, redlistr, remap, roads, robust.prioritizr, rtop, segmetric, sf, sfnetworks, sits, smoothr, spatcovar, spatialrisk, spatialsample, spatsoc, spbal, spdep, spqdep, spsurvey, sspm, stars, starsExtra, starsTileServer, stoichUtilities, terrainr, tidycensus, tinyVAST, tmap, tmap.glyphs, tmap.mapgl, tmaptools, transfR, vein, wikilake, wildlifeDI, xaci, yamlet.

Depended on by Rdistance, photosynthesis, quantities, tealeaves.

Suggested by AISanalyze, CopernicusMarine, DTSg, EML, PKNCA, RCzechia, amt, aopdata, aorsf, babelmixr2, blueterra, camtrapR, capybara, chopin, classInt, constants, countryatlas, cubble, dataquieR, datazoom.amazonia, datazoom.saude, degday, eixport, eplusr, geometa, ggforce, himach, igr, ncdfCF, openrouteservice, osmnxr, paar, palaeoSig, partialling.out, pillar, qatarcars, rDataPipeline, rasterbc, redist, ricu, rmacrostrat, rmapshaper, rxode2, slendr, snapKrig, sociome, spatialEco, stxplore, tidylog, tsbox, waywiser.


See at CRAN