{"id":18983043,"url":"https://github.com/gerrymanoim/humanize","last_synced_at":"2025-12-12T02:28:09.871Z","repository":{"id":56937320,"uuid":"124320460","full_name":"gerrymanoim/humanize","owner":"gerrymanoim","description":"R humanize functions","archived":false,"fork":false,"pushed_at":"2018-04-04T01:32:54.000Z","size":80,"stargazers_count":13,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T17:25:07.292Z","etag":null,"topics":["date","human","human-readable","number","r","time"],"latest_commit_sha":null,"homepage":null,"language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gerrymanoim.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-08T01:49:26.000Z","updated_at":"2024-04-28T03:39:05.000Z","dependencies_parsed_at":"2022-08-21T01:00:09.935Z","dependency_job_id":null,"html_url":"https://github.com/gerrymanoim/humanize","commit_stats":null,"previous_names":["newtux/humanize"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerrymanoim%2Fhumanize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerrymanoim%2Fhumanize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerrymanoim%2Fhumanize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerrymanoim%2Fhumanize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gerrymanoim","download_url":"https://codeload.github.com/gerrymanoim/humanize/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249246228,"owners_count":21237012,"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":["date","human","human-readable","number","r","time"],"created_at":"2024-11-08T16:15:43.191Z","updated_at":"2025-12-12T02:28:04.844Z","avatar_url":"https://github.com/gerrymanoim.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, echo = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"README-\"\n)\n```\n\n# humanize\n\n[![Travis-CI Build Status](https://travis-ci.org/newtux/humanize.svg?branch=master)](https://travis-ci.org/newtux/humanize) [![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/humanize)](https://cran.r-project.org/package=humanize)\n\nHumanize is an almost direct port of the python [humanize package](https://github.com/jmoiron/humanize).\n\nThe goal of humanize is to provide some utlities in order to turn values (so far times, file sizes, and numbers) into human readable forms. \n\n## Installation\n\nYou can install the latest CRAN version with:\n\n```{r cran-installation, eval=FALSE}\ninstall.packages(\"humanize\")\n```\n\nYou can install humanize from github with:\n\n```{r gh-installation, eval = FALSE}\n# install.packages(\"devtools\")\ndevtools::install_github(\"newtux/humanize\")\n```\n\n## Examples\n\n### Times\n\nConvert times:\n\n```{r time_example}\nlibrary(humanize)\n\nnatural_time(Sys.time())\nnatural_time(Sys.time() - 1)\nnatural_time(Sys.time() - 100)\nnatural_time(Sys.time() - 1000*10)\n```\n\nWorks across days:\n\n```{r}\nnatural_time(Sys.time() - lubridate::ddays(1))\nnatural_time(Sys.time() - lubridate::ddays(70))\n```\n\nAnd forward in time:\n\n```{r}\nnatural_time(Sys.time() + lubridate::ddays(1))\n```\n\n### File Sizes\n\nConvert file sizes:\n\n```{r size_example}\nnatural_size(300)\nnatural_size(3000)\nnatural_size(3000000)\nnatural_size(3000000000)\nnatural_size(3000000000000)\nnatural_size(10**26 * 30)\n```\n\n### Numbers\n\nOrdinals:\n\n```{r}\ncount_as_ordinal(1)\ncount_as_ordinal(111)\n```\n\nComma Seperation:\n\n```{r}\nnumber_as_comma(1000)\nnumber_as_comma(10000)\n```\n\nWords:\n\n```{r}\ncount_as_word(100)\ncount_as_word(1000000)\ncount_as_word(1200000000)\n```\n\n\nAP Format:\n\n```{r}\ncount_as_ap(3)\ncount_as_ap(20)\n```\n\n## Todo\n\nThis is still a very early cut of the package. \n\n- Better support in times? For diff time?\n- Maybe add times relative to other times?\n- Export helper functions used in tests?\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgerrymanoim%2Fhumanize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgerrymanoim%2Fhumanize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgerrymanoim%2Fhumanize/lists"}