{"id":21909067,"url":"https://github.com/indenkun/numcomma","last_synced_at":"2025-07-19T17:02:53.397Z","repository":{"id":88527620,"uuid":"317559418","full_name":"indenkun/NumComma","owner":"indenkun","description":"`{NumComma}` can convert between comma-separated and non-comma-separated numbers every three digits on R.","archived":false,"fork":false,"pushed_at":"2021-01-13T13:57:14.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-27T08:11:45.232Z","etag":null,"topics":["comma-separated","comma-separated-values","convert","r"],"latest_commit_sha":null,"homepage":"","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/indenkun.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2020-12-01T14:01:58.000Z","updated_at":"2021-01-13T13:57:17.000Z","dependencies_parsed_at":"2023-07-22T22:46:12.890Z","dependency_job_id":null,"html_url":"https://github.com/indenkun/NumComma","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indenkun%2FNumComma","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indenkun%2FNumComma/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indenkun%2FNumComma/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indenkun%2FNumComma/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/indenkun","download_url":"https://codeload.github.com/indenkun/NumComma/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244924767,"owners_count":20532874,"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":["comma-separated","comma-separated-values","convert","r"],"created_at":"2024-11-28T17:15:04.577Z","updated_at":"2025-03-22T07:48:45.279Z","avatar_url":"https://github.com/indenkun.png","language":"R","readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n[English](README.md) | [日本語](README_JP.md)\n\n# NumComma\n\n\u003c!-- badges: start --\u003e\n\u003c!-- badges: end --\u003e\n\n`{NumComma}` can convert between comma-separated and non-comma-separated numbers every three digits on R. \n\nIt also has the `*_str` function for handling comma-separated and non-comma-separated numbers in a string.\n\n## Installation\n\nYou can install it in\n``` r\nremotes::install_github(\"indenkun/NumComma\")\n```\n\n## Example\n\n```{r example}\nlibrary(NumComma)\n```\n\n`{NumComma}` has two functions: `NumComma_rm` for converting comma-separated numbers into uncomma-separated numbers every three digits, and `NumComma_add` for converting numbers into comma-separated numbers (strings) every three digits. And there are extensions to these functions, `NumComma_rm_str` and `NumComma_add_str`, which perform the conversion for each digit in a string.\n\n### `NumComma_rm` and `NumComma_rm_str`\n\n`NumComma_rm` can convert comma-separated numbers (strings) into numbers without commas every three digits.\n```{r}\nNumComma_rm(\"2,020\")\n```\n\nIf the number does not contain a comma, it returns the same number.\n```{r}\nNumComma_rm(\"2020\")\n```\n\nNumbers containing numbers after the decimal point can also be converted.\n```{r}\nNumComma_rm(\"1,234.56\")\n```\n\nNumbers containing numbers after the decimal point can also be converted.\n```{r}\nx \u003c- c(\"2,020\", \"2020\", \"1,234.56\")\nNumComma_rm(x)\n```\n\nIt is also possible to return the value as a number instead of a string by using `convert` with `TRUE`.\n```{r}\nx \u003c- c(\"2,020\", \"2020\", \"1,234.56\")\nNumComma_rm(x, convert = TRUE)\n```\n\nIf you enter a number with a comma or a non-comma value for every three digits, it returns the value as it was entered with a warning message.\n```{r}\nNumComma_rm(\"1,23,456\")\nNumComma_rm(\"NumComma_rm\")\n```\n\nThe warning text can be disabled by specifying `FALSE` in `Warnig.message`.\n```{r}\nNumComma_rm(c(\"1,23,456\", \"NumComma_rm\"), warnig.message = FALSE)\n```\n\n`NumComma_rm_str` is a function for converting a comma-separated number to an uncomma-separated number for every three digits in a string.\n```{r}\nNumComma_rm_str(\"The total population of Japan is 124,271,318 as of January 1, 2020.\")\n```\n\n### `NumComma_add` and `NumComma_add_str`\n\nNumComma_add` is a function for converting numbers into comma-separated numbers (strings) of three digits.\n\nIt can accept a number or a string that represents a number.\n```{r}\nNumComma_add(123456)\nNumComma_add(\"123456\")\n```\n\nIf you enter consecutive numbers starting from 0 as a string it will return the value as is.\n```{r}\nNumComma_add(\"0001\")\n```\n\nIf you enter a string that is not a number string (including numbers containing commas), it returns the value you entered with a warning message.\n```{r}\nNumComma_add(c(\"NumComma_add\", \"1,234\"))\n```\n\nThe warning text can be disabled by specifying `FALSE` in `Warnig.message`.\n```{r}\nNumComma_add(c(\"NumComma_add\", \"1,234\"), warnig.message = FALSE)\n```\n\nYou can also use `digit` to convert only numbers with more than the number of digits (including decimal places) specified by `digit` into comma-separated numbers with every three digits, or `small.num` to convert only numbers with more than the number of digits specified by `small.num` into comma-separated numbers with every three digits.\n```{r}\nNumComma_add(c(123456, 2020), digit = 4)\nNumComma_add(c(123456, 2020), small.num = 3000)\n```\n\n`NumComma_add_str` is a function for converting numbers in a string to comma-separated numbers.\n```{r}\nNumComma_add_str(\"The total population of Japan is 124271318 people as of January 1, 2020.\")\n```\n\nThe `NumComma_add_str`, like the `NumComma_add`, can control the number to be converted by arguments.\n```{r}\nNumComma_add_str(\"The total population of Japan is 124271318 people as of January 1, 2020.\", digit = 4)\nNumComma_add_str(\"The total population of Japan is 124271318 people as of January 1, 2020.\", small.num = 3000)\n```\n\n## License\n\nMIT.\n\n## Imports\n\n* `{purrr}`\n* `{stringr}`\n* `{stats}`\n* `{dplyr}`\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findenkun%2Fnumcomma","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Findenkun%2Fnumcomma","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findenkun%2Fnumcomma/lists"}