{
  "_id": "6a27b4b824555f66ed5383d3",
  "Package": "phsmethods",
  "Title": "Standard Methods for Use in Public Health Scotland",
  "Version": "1.1.0",
  "Authors@R": "c(\nperson(\"Public Health Scotland\", , , \"phs.datascience@phs.scot\", role = \"cph\"),\nperson(\"David\", \"Caldwell\", , \"David.Caldwell@phs.scot\", role = \"aut\"),\nperson(\"Lucinda\", \"Lawrie\", , \"Lucinda.Lawrie@phs.scot\", role = \"rev\"),\nperson(\"Jack\", \"Hannah\", , \"jack.hannah2@phs.scot\", role = \"aut\"),\nperson(\"Tina\", \"Fu\", , \"Yuyan.Fu2@phs.scot\", role = c(\"aut\", \"cre\")),\nperson(\"Ciara\", \"Gribben\", , \"Ciara.Gribben@phs.scot\", role = \"aut\"),\nperson(\"Chris\", \"Deans\", , \"Chris.Deans2@phs.scot\", role = \"aut\"),\nperson(\"Jaime\", \"Villacampa\", , \"Jaime.Villacampa@phs.scot\", role = \"aut\"),\nperson(\"Graeme\", \"Gowans\", , \"Graeme.Gowans@phs.scot\", role = \"aut\"),\nperson(\"Alice\", \"Byers\", role = \"ctb\"),\nperson(\"Alan\", \"Yeung\", , \"Alan.Yeung@phs.scot\", role = \"ctb\"),\nperson(\"James\", \"Hayes\", , \"James.Hayes2@phs.scot\", role = \"aut\",\ncomment = c(ORCID = \"0000-0002-5380-2029\")),\nperson(\"Nicolaos\", \"Christofidis\", , \"nicolaos.christofidis@phs.scot\", role = \"aut\")\n)",
  "Description": "A collection of methods for commonly undertaken analytical\ntasks, primarily developed for Public Health Scotland (PHS)\nanalysts, but the package is also generally useful to others\nworking in the healthcare space, particularly since it has\nfunctions for working with Community Health Index (CHI)\nnumbers. The package can help to make data manipulation and\nanalysis more efficient and reproducible.",
  "License": "GPL (>= 2)",
  "URL": "https://github.com/Public-Health-Scotland/phsmethods,\nhttps://public-health-scotland.github.io/phsmethods/",
  "BugReports": "https://github.com/Public-Health-Scotland/phsmethods/issues",
  "VignetteBuilder": "knitr",
  "RdMacros": "lifecycle",
  "Config/roxygen2/markdown": "TRUE",
  "Config/roxygen2/version": "8.0.0",
  "Config/testthat/edition": "3",
  "Encoding": "UTF-8",
  "Language": "en-GB",
  "LazyData": "true",
  "Config/pak/sysreqs": "libicu-dev libx11-dev",
  "Repository": "https://public-health-scotland.r-universe.dev",
  "Date/Publication": "2026-05-10 10:17:20 UTC",
  "RemoteUrl": "https://github.com/public-health-scotland/phsmethods",
  "RemoteRef": "HEAD",
  "RemoteSha": "a4306f931e1b709492591969a9a4751493c661ba",
  "NeedsCompilation": "no",
  "Packaged": {
    "Date": "2026-06-09 06:05:23 UTC",
    "User": "root"
  },
  "Author": "Public Health Scotland [cph],\nDavid Caldwell [aut],\nLucinda Lawrie [rev],\nJack Hannah [aut],\nTina Fu [aut, cre],\nCiara Gribben [aut],\nChris Deans [aut],\nJaime Villacampa [aut],\nGraeme Gowans [aut],\nAlice Byers [ctb],\nAlan Yeung [ctb],\nJames Hayes [aut] (ORCID: <https://orcid.org/0000-0002-5380-2029>),\nNicolaos Christofidis [aut]",
  "Maintainer": "Tina Fu <Yuyan.Fu2@phs.scot>",
  "MD5sum": "5395c94fe769bec9da51ec48586f04b9",
  "_user": "public-health-scotland",
  "_type": "src",
  "_file": "phsmethods_1.1.0.tar.gz",
  "_fileid": "34cf12829c08dcf658ecd9827a143c4fdb2409b7da0f3badb0870f46f3d72dd0",
  "_filesize": 449835,
  "_sha256": "34cf12829c08dcf658ecd9827a143c4fdb2409b7da0f3badb0870f46f3d72dd0",
  "_created": "2026-06-09T06:05:23.000Z",
  "_published": "2026-06-09T06:37:44.853Z",
  "_distro": "noble",
  "_jobs": [
    {
      "job": 80258808922,
      "time": 162,
      "config": "linux-devel-x86_64",
      "r": "4.7.0",
      "check": "NOTE",
      "artifact": "7499773908"
    },
    {
      "job": 80258808953,
      "time": 151,
      "config": "linux-release-x86_64",
      "r": "4.6.0",
      "check": "NOTE",
      "artifact": "7499771041"
    },
    {
      "job": 80258808892,
      "time": 214,
      "config": "macos-oldrel-arm64",
      "r": "4.5.3",
      "check": "NOTE",
      "artifact": "7500196287"
    },
    {
      "job": 80258808923,
      "time": 158,
      "config": "macos-release-arm64",
      "r": "4.6.0",
      "check": "NOTE",
      "artifact": "7500227256"
    },
    {
      "job": 80258416902,
      "time": 183,
      "config": "source",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7499732162"
    },
    {
      "job": 80258808901,
      "time": 134,
      "config": "wasm-release",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7499766339"
    },
    {
      "job": 80258808930,
      "time": 120,
      "config": "windows-devel",
      "r": "4.7.0",
      "check": "NOTE",
      "artifact": "7499763037"
    },
    {
      "job": 80258809018,
      "time": 72,
      "config": "windows-oldrel",
      "r": "4.5.3",
      "check": "NOTE",
      "artifact": "7499750838"
    },
    {
      "job": 80258808955,
      "time": 107,
      "config": "windows-release",
      "r": "4.6.0",
      "check": "NOTE",
      "artifact": "7499760133"
    }
  ],
  "_buildurl": "https://github.com/r-universe/public-health-scotland/actions/runs/27187109693",
  "_status": "success",
  "_host": "GitHub-Actions",
  "_upstream": "https://github.com/public-health-scotland/phsmethods",
  "_commit": {
    "id": "a4306f931e1b709492591969a9a4751493c661ba",
    "author": "James Hayes (né McMahon) <james.hayes2@phs.scot>",
    "committer": "GitHub <noreply@github.com>",
    "message": "Merge pull request #174 from Public-Health-Scotland/dependabot/github_actions/Public-Health-Scotland/actions/dot-github/workflows/phs_package_checks.yaml-2.6.0\n\nBump Public-Health-Scotland/actions/.github/workflows/phs_package_checks.yaml from 2.4.1 to 2.6.0",
    "time": 1778408240
  },
  "_maintainer": {
    "name": "Tina Fu",
    "email": "yuyan.fu2@phs.scot",
    "login": "tina815",
    "description": "",
    "uuid": 31853064
  },
  "_registered": true,
  "_dependencies": [
    {
      "package": "R",
      "version": ">= 3.6",
      "role": "Depends"
    },
    {
      "package": "cli",
      "role": "Imports"
    },
    {
      "package": "dplyr",
      "role": "Imports"
    },
    {
      "package": "lifecycle",
      "role": "Imports"
    },
    {
      "package": "lubridate",
      "role": "Imports"
    },
    {
      "package": "magrittr",
      "role": "Imports"
    },
    {
      "package": "readr",
      "role": "Imports"
    },
    {
      "package": "rlang",
      "role": "Imports"
    },
    {
      "package": "scales",
      "version": ">= 1.0.0",
      "role": "Imports"
    },
    {
      "package": "stringr",
      "role": "Imports"
    },
    {
      "package": "tibble",
      "role": "Imports"
    },
    {
      "package": "utils",
      "role": "Imports"
    },
    {
      "package": "withr",
      "role": "Imports"
    },
    {
      "package": "covr",
      "role": "Suggests"
    },
    {
      "package": "flextable",
      "role": "Suggests"
    },
    {
      "package": "ggplot2",
      "role": "Suggests"
    },
    {
      "package": "here",
      "role": "Suggests"
    },
    {
      "package": "knitr",
      "role": "Suggests"
    },
    {
      "package": "rmarkdown",
      "role": "Suggests"
    },
    {
      "package": "spelling",
      "role": "Suggests"
    },
    {
      "package": "testthat",
      "version": ">= 3.0.0",
      "role": "Suggests"
    }
  ],
  "_owner": "public-health-scotland",
  "_selfowned": true,
  "_usedby": 0,
  "_updates": [
    {
      "week": "2025-36",
      "n": 1
    },
    {
      "week": "2025-37",
      "n": 1
    },
    {
      "week": "2025-40",
      "n": 3
    },
    {
      "week": "2025-43",
      "n": 1
    },
    {
      "week": "2025-44",
      "n": 1
    },
    {
      "week": "2025-45",
      "n": 7
    },
    {
      "week": "2025-48",
      "n": 3
    },
    {
      "week": "2026-06",
      "n": 1
    },
    {
      "week": "2026-07",
      "n": 3
    },
    {
      "week": "2026-15",
      "n": 1
    },
    {
      "week": "2026-19",
      "n": 1
    }
  ],
  "_tags": [
    {
      "name": "1.1.0",
      "date": "2026-04-07"
    }
  ],
  "_stars": 58,
  "_contributors": [
    {
      "user": "moohan",
      "count": 243,
      "uuid": 5982260
    },
    {
      "user": "jackhannah95",
      "count": 208,
      "uuid": 38332502
    },
    {
      "user": "tina815",
      "count": 117,
      "uuid": 31853064
    },
    {
      "user": "nic-chr",
      "count": 44,
      "uuid": 74770457
    },
    {
      "user": "jvillacampa",
      "count": 40,
      "uuid": 30340183
    },
    {
      "user": "davidc92",
      "count": 18,
      "uuid": 33342336
    },
    {
      "user": "jokpro",
      "count": 17,
      "uuid": 57229241
    },
    {
      "user": "chrisdeans",
      "count": 15,
      "uuid": 23474011
    },
    {
      "user": "graemegowans",
      "count": 7,
      "uuid": 47667899
    },
    {
      "user": "rmccreath",
      "count": 3,
      "uuid": 33964310
    },
    {
      "user": "ciarag01",
      "count": 1,
      "uuid": 36995878
    },
    {
      "user": "alice-hannah",
      "count": 1,
      "uuid": 36480969
    }
  ],
  "_userbio": {
    "uuid": 35955342,
    "type": "organization",
    "name": "Public Health Scotland"
  },
  "_downloads": {
    "count": 504,
    "source": "https://cranlogs.r-pkg.org/downloads/total/last-month/phsmethods"
  },
  "_devurl": "https://github.com/public-health-scotland/phsmethods",
  "_pkgdown": "https://public-health-scotland.github.io/phsmethods/",
  "_searchresults": 130,
  "_rbuild": "4.6.0",
  "_assets": [
    "extra/citation.cff",
    "extra/citation.html",
    "extra/citation.json",
    "extra/citation.txt",
    "extra/contents.json",
    "extra/NEWS.html",
    "extra/NEWS.txt",
    "extra/phsmethods.html",
    "extra/readme.html",
    "extra/readme.md",
    "manual.pdf"
  ],
  "_homeurl": "https://github.com/public-health-scotland/phsmethods",
  "_realowner": "public-health-scotland",
  "_cranurl": true,
  "_releases": [
    {
      "version": "1.0.0",
      "date": "2023-11-03"
    },
    {
      "version": "1.0.1",
      "date": "2023-11-28"
    },
    {
      "version": "1.0.2",
      "date": "2024-01-09"
    },
    {
      "version": "1.1.0",
      "date": "2026-03-30"
    }
  ],
  "_exports": [
    "age_calculate",
    "age_from_chi",
    "as_percent",
    "chi_check",
    "chi_pad",
    "create_age_groups",
    "dob_from_chi",
    "extract_fin_year",
    "file_size",
    "format_postcode",
    "match_area",
    "NA_percent_",
    "qtr",
    "qtr_end",
    "qtr_next",
    "qtr_prev",
    "sex_from_chi"
  ],
  "_datasets": [
    {
      "name": "area_lookup",
      "title": "Codes and names of Scottish geographical and administrative areas.",
      "object": "area_lookup",
      "class": [
        "tbl_df",
        "tbl",
        "data.frame"
      ],
      "fields": [
        "geo_code",
        "area_name"
      ],
      "rows": 17278,
      "table": true,
      "tojson": true
    }
  ],
  "_help": [
    {
      "page": "age_calculate",
      "title": "Calculate age between two dates",
      "topics": [
        "age_calculate"
      ]
    },
    {
      "page": "age_from_chi",
      "title": "Extract age from the CHI number",
      "topics": [
        "age_from_chi"
      ]
    },
    {
      "page": "area_lookup",
      "title": "Codes and names of Scottish geographical and administrative areas.",
      "topics": [
        "area_lookup"
      ]
    },
    {
      "page": "percent",
      "title": "Percentages",
      "topics": [
        "as_percent",
        "NA_percent_"
      ]
    },
    {
      "page": "chi_check",
      "title": "Check the validity of a CHI number",
      "topics": [
        "chi_check"
      ]
    },
    {
      "page": "chi_pad",
      "title": "Add a leading zero to nine-digit CHI numbers",
      "topics": [
        "chi_pad"
      ]
    },
    {
      "page": "create_age_groups",
      "title": "Create age groups",
      "topics": [
        "create_age_groups"
      ]
    },
    {
      "page": "dob_from_chi",
      "title": "Extract Date of Birth (DoB) from the CHI number",
      "topics": [
        "dob_from_chi"
      ]
    },
    {
      "page": "extract_fin_year",
      "title": "Extract the formatted financial year from a date",
      "topics": [
        "extract_fin_year"
      ]
    },
    {
      "page": "format_postcode",
      "title": "Format a postcode",
      "topics": [
        "format_postcode"
      ]
    },
    {
      "page": "match_area",
      "title": "Translate geography codes into area names",
      "topics": [
        "match_area"
      ]
    },
    {
      "page": "qtr",
      "title": "Assign a date to a quarter",
      "topics": [
        "qtr",
        "qtr_end",
        "qtr_next",
        "qtr_prev"
      ]
    },
    {
      "page": "sex_from_chi",
      "title": "Extract sex from the CHI number",
      "topics": [
        "sex_from_chi"
      ]
    }
  ],
  "_readme": "https://github.com/public-health-scotland/phsmethods/raw/HEAD/README.md",
  "_rundeps": [
    "bit",
    "bit64",
    "cli",
    "clipr",
    "cpp11",
    "crayon",
    "dplyr",
    "farver",
    "generics",
    "glue",
    "hms",
    "labeling",
    "lifecycle",
    "lubridate",
    "magrittr",
    "pillar",
    "pkgconfig",
    "prettyunits",
    "progress",
    "R6",
    "RColorBrewer",
    "readr",
    "rlang",
    "scales",
    "stringi",
    "stringr",
    "tibble",
    "tidyselect",
    "timechange",
    "tzdb",
    "utf8",
    "vctrs",
    "viridisLite",
    "vroom",
    "withr"
  ],
  "_vignettes": [
    {
      "source": "percent.Rmd",
      "filename": "percent.html",
      "title": "Using percent vectors",
      "author": "Nick Christofides",
      "engine": "knitr::rmarkdown",
      "headings": [
        "Motivation",
        "Creating percentages",
        "Rounding",
        "Rounding via as_percent + digits",
        "Rounding via round()",
        "Math with percent vectors",
        "percent vectors and tidyverse",
        " vectors and formatted tables",
        "percent vectors and ggplot2"
      ],
      "created": "2026-02-05 12:03:38",
      "modified": "2026-02-05 12:03:38",
      "commits": 1
    },
    {
      "source": "chi-operations.Rmd",
      "filename": "chi-operations.html",
      "title": "Working with CHI numbers",
      "author": "James McMahon",
      "engine": "knitr::rmarkdown",
      "headings": [
        "Checking and correcting CHI numbers",
        "Cleaning up bad CHI numbers",
        "Inferring data from a CHI number",
        "The structure of a CHI number",
        "Extracting sex from CHI",
        "Extracting Date of Birth from CHI",
        "Extracting age from CHI"
      ],
      "created": "2023-11-28 14:54:36",
      "modified": "2023-11-28 14:54:36",
      "commits": 1
    }
  ],
  "_score": 8.960156716186225,
  "_indexed": true,
  "_nocasepkg": "phsmethods",
  "_universes": [
    "public-health-scotland",
    "tina815"
  ],
  "_binaries": [
    {
      "r": "4.7.0",
      "os": "linux",
      "version": "1.1.0",
      "date": "2026-06-09T06:07:56.000Z",
      "distro": "noble",
      "commit": "a4306f931e1b709492591969a9a4751493c661ba",
      "fileid": "0a9d5769d4e5a54199379741dd621393f8e9125367b77881fc26f4ff6d80c459",
      "status": "success",
      "check": "NOTE",
      "buildurl": "https://github.com/r-universe/public-health-scotland/actions/runs/27187109693"
    },
    {
      "r": "4.6.0",
      "os": "linux",
      "version": "1.1.0",
      "date": "2026-06-09T06:07:45.000Z",
      "distro": "noble",
      "commit": "a4306f931e1b709492591969a9a4751493c661ba",
      "fileid": "ae4cb002846b83f2288699c3d525910689537e61baa249cff474aec9246c2726",
      "status": "success",
      "check": "NOTE",
      "buildurl": "https://github.com/r-universe/public-health-scotland/actions/runs/27187109693"
    },
    {
      "r": "4.5.3",
      "os": "mac",
      "version": "1.1.0",
      "date": "2026-06-09T06:34:43.000Z",
      "commit": "a4306f931e1b709492591969a9a4751493c661ba",
      "fileid": "97719b0bebef41627b231d04888098f35c0c51734ecb78a439e6bf816c2aad5c",
      "status": "success",
      "check": "NOTE",
      "buildurl": "https://github.com/r-universe/public-health-scotland/actions/runs/27187109693"
    },
    {
      "r": "4.6.0",
      "os": "mac",
      "version": "1.1.0",
      "date": "2026-06-09T06:36:43.000Z",
      "commit": "a4306f931e1b709492591969a9a4751493c661ba",
      "fileid": "913b1295186315b900b2836240417d7dc29a6efe7fcb1b82731b30809d480ed0",
      "status": "success",
      "check": "NOTE",
      "buildurl": "https://github.com/r-universe/public-health-scotland/actions/runs/27187109693"
    },
    {
      "r": "4.6.0",
      "os": "wasm",
      "version": "1.1.0",
      "date": "2026-06-09T06:07:51.000Z",
      "commit": "a4306f931e1b709492591969a9a4751493c661ba",
      "fileid": "159d44d98f7a8471378db5eb5bbd79aaedac929b579dae2c75e71d9ff1b41dd6",
      "status": "success",
      "buildurl": "https://github.com/r-universe/public-health-scotland/actions/runs/27187109693"
    },
    {
      "r": "4.7.0",
      "os": "win",
      "version": "1.1.0",
      "date": "2026-06-09T06:07:04.000Z",
      "commit": "a4306f931e1b709492591969a9a4751493c661ba",
      "fileid": "212ae74a9c0aff86d8eeea0d609e6d106ea558a83f9db6d524751d8f254148d2",
      "status": "success",
      "check": "NOTE",
      "buildurl": "https://github.com/r-universe/public-health-scotland/actions/runs/27187109693"
    },
    {
      "r": "4.5.3",
      "os": "win",
      "version": "1.1.0",
      "date": "2026-06-09T06:06:30.000Z",
      "commit": "a4306f931e1b709492591969a9a4751493c661ba",
      "fileid": "877c853d5a4e74d09a0c4cfc1b05cb99a676cc5566b159afb8934036abc7647c",
      "status": "success",
      "check": "NOTE",
      "buildurl": "https://github.com/r-universe/public-health-scotland/actions/runs/27187109693"
    },
    {
      "r": "4.6.0",
      "os": "win",
      "version": "1.1.0",
      "date": "2026-06-09T06:06:41.000Z",
      "commit": "a4306f931e1b709492591969a9a4751493c661ba",
      "fileid": "357765454ce67c87eaeafe58e61b04df3da54f0a1f9933a2c49917c2aea99e7a",
      "status": "success",
      "check": "NOTE",
      "buildurl": "https://github.com/r-universe/public-health-scotland/actions/runs/27187109693"
    }
  ]
}