{"id":18733531,"url":"https://github.com/insightsengineering/rvalidationhub-packages","last_synced_at":"2026-01-24T05:35:15.486Z","repository":{"id":248099107,"uuid":"824513465","full_name":"insightsengineering/rvalidationhub-packages","owner":"insightsengineering","description":"Snapshot of validated R packages for R validation hub","archived":false,"fork":false,"pushed_at":"2024-07-12T10:05:33.000Z","size":1278,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2024-12-28T15:48:30.310Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://insightsengineering.github.io/rvalidationhub-packages/","language":"HTML","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/insightsengineering.png","metadata":{"files":{"readme":"README.qmd","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"custom":["https://pharmaverse.org"]}},"created_at":"2024-07-05T09:42:08.000Z","updated_at":"2024-10-15T09:21:23.000Z","dependencies_parsed_at":"2024-07-12T11:44:43.411Z","dependency_job_id":null,"html_url":"https://github.com/insightsengineering/rvalidationhub-packages","commit_stats":null,"previous_names":["insightsengineering/rvalidationhub-packages"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insightsengineering%2Frvalidationhub-packages","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insightsengineering%2Frvalidationhub-packages/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insightsengineering%2Frvalidationhub-packages/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insightsengineering%2Frvalidationhub-packages/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/insightsengineering","download_url":"https://codeload.github.com/insightsengineering/rvalidationhub-packages/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239605124,"owners_count":19666998,"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-07T15:10:19.348Z","updated_at":"2025-11-14T04:30:16.281Z","avatar_url":"https://github.com/insightsengineering.png","language":"HTML","funding_links":["https://pharmaverse.org"],"categories":[],"sub_categories":[],"readme":"---\ntitle: \"Validated R packages\"\nformat:\n   html: \n    output-file: \"index\"\n    output-ext:  \"html\"\n---\n\n## Context\n\nThe code and license is at [github.com/insightsengineering/rvalidationhub-packages](https://github.com/insightsengineering/rvalidationhub-packages).\n\nThis document summarises validated R packages by R version as it was at \n`r Sys.time()`.\n\nIt is important to note R package functionality is validated via a risk based \napproach, and package functionality is tested and documented against specific\nenvironments as a rolling cohort. R packages are not intended to be used \noutside the 'snapshot' they were validated within. In this repo you cannot see the environments we use, or how the \npackage cohorts are defined temporally so cannot assume the packages will be stable on your environment and with a different cohort of package versions.\n\nA small number of validated packages are not open sourced, usually as they are specific to our infrastructure (e.g. wrappers to simplify working against our Redshift, S3 or Snowflake instances).\n\nWe do not currently have a concept of 'validated' Shiny applications (we do \nhave a business process, in the same way study code is QC'd, not 'validated' \nvia a CSV process).\n\n## Output\n\nA table is shown in the footer of this document, and a parquet file is saved in the root of this repo [`validated_packages.parquet`](validated_packages.parquet).\n\n## Code\n\n```{r,results='hide', warning=FALSE, message=FALSE}\nlibrary(httr)\nlibrary(stringr)\nlibrary(dplyr)\nlibrary(glue)\nlibrary(tibble)\nlibrary(purrr)\nlibrary(tidyr)\nlibrary(gt)\nlibrary(arrow)\nlibrary(tictoc)\n```\n\n```{r}\n#| label: setup\n#| echo: false\n\n\nknitr::knit_hooks$set(timeit = function(before, options, envir) {\n    if(before) {\n      ## code to be run before a chunk\n      tic()\n    } else {\n      ## code to be run after a chunk\n      elapsed = toc()$toc\n      print(paste0(\"Execution took \", elapsed, \" seconds\"))\n    }\n})\n\n```\n\n```{r}\n#| timeit: true\n\n\n# variables\nhost \u003c- \"https://packages.roche.com/\"\n\n# get all repos\nresponse \u003c- httr::content(httr::GET(\n  paste0(host, \"__api__/repos\")\n))\n\n# flatten response into a tibble\ntibble_repos \u003c- tibble(\n  id = unlist(map(response, \"id\")),\n  name = unlist(map(response, \"name\"))\n  ) |\u003e\n  # keeping only validated\n  dplyr::filter(\n    str_detect(`name`,pattern = \"^Validated\")\n  ) |\u003e\n  # new column for R version\n  dplyr::mutate(\n    r_version = str_extract(`name`, pattern = \"\\\\d+\\\\.\\\\d+\")\n  ) |\u003e\n  # remove 3.10\n  filter(r_version != \"3.10\")\n  \n# get all packages for a repo\nvalidated_packages \u003c- tibble()\nfor (i in 1:nrow(tibble_repos)) {\n  # take single repo\n  i_row \u003c- slice(tibble_repos,i)\n  # raw list of current packages\n  response \u003c- httr::content(httr::GET(\n    glue(\"{host}__api__/repos/{i_row$id}/packages?_limit=1000\")\n  ))\n  # package version live right now\n  tibble_packages \u003c- tibble(\n    r_version = i_row$r_version,\n    name = unlist(map(response, \"name\")),\n    version = unlist(map(response, \"version\"))\n  ) \n  # Check no pagination\n  if (length(response) \u003e 999) stop(\"Pagination not implemented: 1000+ packages in a repo.\")\n  # get archives\n  for (j in 1:nrow(tibble_packages)) {\n    \n    j_row \u003c- slice(tibble_packages,j)\n    \n    # get package details\n    response \u003c- httr::content(httr::GET(\n      glue(\"{host}__api__/repos/{i_row$id}/packages/{j_row$name}\")\n    ))\n    \n    validated_packages \u003c- j_row |\u003e\n      bind_rows(validated_packages)\n    \n    # archived\n    if (!is.null(response$archived)){\n      archived_packages \u003c- tibble(\n        r_version = i_row$r_version,\n        name = unlist(map(response$archived, \"name\")),\n        version = unlist(map(response$archived, \"version\"))\n        ) \n      \n      validated_packages \u003c- validated_packages |\u003e\n        bind_rows(archived_packages)\n    }\n\n  }\n}\n\n# Ordering\nvalidated_packages \u003c- validated_packages |\u003e\n  arrange(\n    r_version,\n    name,\n    version\n  )\n\n# Save copy\nwrite_parquet(validated_packages, \"validated_packages.parquet\")\n\n# wide table\nvalidated_packages |\u003e\n  tidyr::pivot_wider(\n    names_from = r_version,\n    values_from = version,\n    values_fn = list\n  ) |\u003e\n  arrange(name) |\u003e\n  gt() |\u003e\n  tab_header(\n    title = \"Validated R packages\",\n    subtitle = glue(\"Generated on {Sys.Date()}, grouped by R version validated against\")\n  ) |\u003e\n  opt_interactive(\n    use_search = TRUE,\n    use_filters = TRUE,\n    use_resizers = TRUE,\n    use_highlight = TRUE,\n    use_compact_mode = FALSE,\n    use_text_wrapping = TRUE,\n    use_page_size_select = TRUE\n  )\n\n\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finsightsengineering%2Frvalidationhub-packages","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finsightsengineering%2Frvalidationhub-packages","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finsightsengineering%2Frvalidationhub-packages/lists"}