{"id":18174443,"url":"https://github.com/r-quantities/units","last_synced_at":"2025-05-15T02:08:37.607Z","repository":{"id":9031061,"uuid":"60592582","full_name":"r-quantities/units","owner":"r-quantities","description":"Measurement units for R","archived":false,"fork":false,"pushed_at":"2025-04-16T20:39:35.000Z","size":8452,"stargazers_count":183,"open_issues_count":14,"forks_count":32,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-05-03T01:45:41.366Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://r-quantities.github.io/units","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/r-quantities.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-06-07T07:39:42.000Z","updated_at":"2025-04-16T20:39:40.000Z","dependencies_parsed_at":"2023-11-28T14:29:13.097Z","dependency_job_id":"44c8f746-22bd-4e11-b982-dd61b0d66453","html_url":"https://github.com/r-quantities/units","commit_stats":{"total_commits":703,"total_committers":24,"mean_commits":"29.291666666666668","dds":0.534850640113798,"last_synced_commit":"dca9e63e82fad03b6d51de357044e31de727c780"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-quantities%2Funits","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-quantities%2Funits/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-quantities%2Funits/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-quantities%2Funits/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/r-quantities","download_url":"https://codeload.github.com/r-quantities/units/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254042874,"owners_count":22004907,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-02T16:03:07.070Z","updated_at":"2025-05-15T02:08:37.568Z","avatar_url":"https://github.com/r-quantities.png","language":"R","funding_links":[],"categories":["R"],"sub_categories":[],"readme":"# \u003cimg src=\"https://avatars1.githubusercontent.com/u/32303769?s=40\u0026v=4\"\u003e Measurement Units for R\n\n\u003c!-- badges: start --\u003e\n[![Build Status](https://github.com/r-quantities/units/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/r-quantities/units/actions/workflows/build.yml)\n[![Coverage Status](https://img.shields.io/codecov/c/github/r-quantities/units/master.svg)](https://app.codecov.io/github/r-quantities/units?branch=master)\n[![License](http://img.shields.io/badge/license-GPL%20%28%3E=%202%29-brightgreen.svg?style=flat)](http://www.gnu.org/licenses/gpl-2.0.html) [![CRAN](https://www.r-pkg.org/badges/version/units)](https://cran.r-project.org/package=units)\n[![Downloads](https://cranlogs.r-pkg.org/badges/units?color=brightgreen)](https://www.r-pkg.org/pkg/units)\n\u003c!-- badges: end --\u003e\n\nSupport for measurement units in R vectors, matrices\nand arrays: automatic propagation, conversion, derivation\nand simplification of units; raising errors in case of unit\nincompatibility. Compatible with the POSIXct, Date and difftime \nclasses. Uses the UNIDATA udunits library and unit database for \nunit compatibility checking and conversion.\n\n### Documentation\n\nDocumentation is provided in an R Journal publication. Cite this package as:\n\n- Edzer Pebesma, Thomas Mailund and James Hiebert (2016). \"Measurement Units in R.\"\n  _The R Journal_, 8 (2), 486--494. \n  DOI: [10.32614/RJ-2016-061](https://doi.org/10.32614/RJ-2016-061)\n\nThe main units\n[vignette](https://r-quantities.github.io/units/articles/measurement_units_in_R.html)\nderives from this manuscript and is kept up to date with the package development.\n\n- Blog posts: [first](https://r-spatial.org/r/2016/06/10/units.html),\n  [second](https://r-spatial.org/r/2016/08/16/units2.html),\n  [third](https://r-spatial.org/r/2016/09/29/plot_units.html).\n- The UNIDATA [udunits2](https://github.com/Unidata/UDUNITS-2) library at GitHub.\n\n### What it does\n\nPackage `units` provides\nmeasurement units for R vectors: conversion, derivation, simplification and error checking:\n\n```r\nlibrary(units)\n(spd1 = set_units(1:5, m/s))\n# Units: m/s\n# [1] 1 2 3 4 5\n(spd2 = set_units(1:5, km/h))\n# Units: km/h\n# [1] 1 2 3 4 5\nspd1 + spd2                   # automatic conversion\n# Units: m/s\n# [1] 1.277778 2.555556 3.833333 5.111111 6.388889\nspd1 * spd2                   # unit derivation\n# Units: km*m/h/s\n# [1]  1  4  9 16 25\nspd1 * set_units(10, s) # unit simplification\n# Units: m\n# [1] 10 20 30 40 50\nspd1 + set_units(10, s) # error checking\n#   cannot convert s into m/s\n```\n\n### Installation\n\nInstall the release version from CRAN:\n\n```r\ninstall.packages(\"units\")\n```\n\nThe installation of the development version from GitHub requires, e.g., the `remotes` package:\n\n```r\nremotes::install_github(\"r-quantities/units\")\n```\n\nIf the installation fails due to a missing udunits2 system library, either install it e.g. on Ubuntu or Debian by\n\n```\nsudo apt-get install libudunits2-dev\n```\non Fedora or RHEL/CentOS with\n```\nsudo dnf install udunits2-devel\n```\nor on MacOS with\n```\nbrew install udunits\n```\nor equivalent in your distribution. Alternatively, install it from the sources by downloading the latest version from [UDUNITS downloads](https://downloads.unidata.ucar.edu/udunits/), and executing the following commands in the download directory:\n\n```\ntar zxf udunits-\u003cversion\u003e.tar.gz\ncd ./udunits-\u003cversion\u003e/\n./configure\nmake\nsudo make install\nsudo ldconfig\n```\n\nThen, retry the installation of `units`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-quantities%2Funits","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fr-quantities%2Funits","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-quantities%2Funits/lists"}