{"id":23288057,"url":"https://github.com/iom/iomthemes","last_synced_at":"2025-07-29T05:06:54.130Z","repository":{"id":267151455,"uuid":"900394805","full_name":"iom/iomthemes","owner":"iom","description":"IOM 'ggplot2' Theme and Colour Palettes","archived":false,"fork":false,"pushed_at":"2025-01-07T16:11:31.000Z","size":54325,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-06T16:32:55.176Z","etag":null,"topics":["ggplot2-themes","r"],"latest_commit_sha":null,"homepage":"https://iom.github.io/iomthemes/","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/iom.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2024-12-08T17:04:39.000Z","updated_at":"2025-01-17T17:30:12.000Z","dependencies_parsed_at":"2025-01-07T17:34:17.481Z","dependency_job_id":null,"html_url":"https://github.com/iom/iomthemes","commit_stats":{"total_commits":7,"total_committers":1,"mean_commits":7.0,"dds":0.0,"last_synced_commit":"d5fba87373137f177a0b84a955e74c7c444a8262"},"previous_names":["iom/iomthemes"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/iom/iomthemes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iom%2Fiomthemes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iom%2Fiomthemes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iom%2Fiomthemes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iom%2Fiomthemes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iom","download_url":"https://codeload.github.com/iom/iomthemes/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iom%2Fiomthemes/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267632911,"owners_count":24118750,"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","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["ggplot2-themes","r"],"created_at":"2024-12-20T03:13:38.471Z","updated_at":"2025-07-29T05:06:54.104Z","avatar_url":"https://github.com/iom.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, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  fig.retina = 2,\n  dpi = 300,\n  dev = \"ragg_png\"\n)\n```\n\n\n## Overview\n\n\u003c!-- badges: start --\u003e\n\u003c!-- badges: end --\u003e\n\nThe [International Organisation for Migration](http://iom.int) is part of the United Nations System. \nThe organisation supports three main strategic objectives:   \n\n  1. Saving lives and protecting people on the move,  \n  \n  2. Driving solutions to displacement,  \n  \n  3. Facilitating pathways for regular migration.  \n\n`{iomthemes}` R package aims at simplifying the creation of data visualizations and data stories. This package offers a comprehensive `{ggplot2}` theme, including built-in customization and color palettes. It is designed to quickly align reproducible plots with IOM Visual Branding Recommendations. \n\n\n## Installation\n\nThis package is not yet available on CRAN.\n\nRetrieve the development version from Github using the `{pak}` package:\n\n```{r pak, eval=FALSE}\ninstall.packages(\"pak\")\npak::pkg_install(\"iom/iomthemes\")\n```\n\n## Usage\n\nAfter loading the `{iomthemes}` package, you can apply the theme to any `{ggplot2}` chart, by simply either adding a [specific color from one the palette](https://iom.github.io/iomthemes/reference/iom_pal.html) or use one of the [color scaling functions](https://iom.github.io/iomthemes/reference/iom_scale.html) and  [`theme_iom()`](https://iom.github.io/iomthemes/reference/theme_iom.html) at the end of your plot.\n\nBelow is an example using the excel demo dataset from UNDESA bundled within the package.\n\n```{r message=FALSE, warning=FALSE}\nlibrary(tidyverse)\nlibrary(iomthemes)\n\nreadxl::read_excel(system.file(\n  \"undesa_pd_2020_ims_stock_by_sex_destination_and_origin.xlsx\",\n                                           package = \"iomthemes\"),\n  col_types = c(\"numeric\", \"text\", \"text\",\"numeric\", \"text\",\n               \"text\", \"numeric\",\n              \"numeric\",\"numeric\", \"numeric\", \"numeric\",\"numeric\",\"numeric\",\n              \"numeric\", \"numeric\", \"numeric\", \"numeric\", \"numeric\", \"numeric\", \n              \"numeric\",\"numeric\", \"numeric\", \"numeric\", \"numeric\", \"numeric\",\n              \"numeric\",\"numeric\", \"numeric\" ), \n  sheet = \"Table 1\", skip = 9) |\u003e\n  ## Getting clean variable names\n  janitor::clean_names() |\u003e\n  dplyr::rename(\"total.2020\"=\"x2020_14\")|\u003e\n  # Add ISO2 country code to identify the country level records \n  dplyr::mutate( \n    origin.iso2 = countrycode::countrycode(\n                    location_code_of_origin,\n                    origin = \"un\",\n                    destination = \"iso2c\"),\n    destination.iso2 = countrycode::countrycode(\n                    location_code_of_destination,\n                    origin = \"un\",\n                    destination = \"iso2c\")) |\u003e\n  # Filter out rows where 'origin.iso2' and 'origin.iso2' is NA (missing)\n  # We do so to keep only country level records - filter out region subtotal\n  filter( !(is.na(origin.iso2)) ) |\u003e\n  filter( !(is.na(destination.iso2)) ) |\u003e\n  # Group the data by country of origin\n  group_by(region_development_group_country_or_area_of_origin) |\u003e\n  # Summarize the total number of migrants for the year 2020 \u0026 remove NA! \n  summarise(total_migrants_2020 = sum(total.2020, na.rm = TRUE)) |\u003e\n  # Arrange the summarized data in descending order of total migrants\n  arrange(desc(total_migrants_2020)) |\u003e\n  # Select the top 10 countries of origin with the highest number of migrants\n  slice_head(n = 10)  |\u003e\n  ggplot(\n    aes(x = reorder(region_development_group_country_or_area_of_origin,\n                    total_migrants_2020),\n             y = total_migrants_2020)) +\n  # Define it as a bar chart and apply IOM color palette\n  geom_bar(stat = \"identity\",\n           ## Apply IOM color palette!\n           fill = iomthemes::iom_pal(n = 1, name= \"pal_blue\"),\n           width = 0.8) +\n  # Flip the chart to make it more legible\n  coord_flip()  +\n  ## Format the labels for the x axis\n  scale_y_continuous(\n    labels = scales::label_number(scale_cut = scales::cut_short_scale())) +\n  labs(\n    title = \"Main Countries of Migrant Origin\",\n    subtitle = \"Highlighting the top 10 countries contributing to global\n                migration | 2020\",\n       x = \"Country of Origin\",\n       y = \"Total Migrants (2020)\",\n       caption = \"Source: United Nations Department of Economic and Social \n       Affairs, Population Division. International Migrant Stock (2020)\") +\n  ## and apply IOM theme\n  iomthemes::theme_iom(grid = \"X\", axis = \"Y\", axis_title = \"X\")\n```\n\n\nYou can explore examples of `{iomthemes}` in action through the [package vignette](iomthemes.html).\n\nThis package can and should be used in conjunction with [{iomdown}](https://iom.github.io/iomdown) to make reproducible reports and  [{iomquarto}](https://iom.github.io/iomquarto) to develop web pages, presentation and data scrolly-telling.\n\n## Contribution and Code of Conduct\n\nContributions to `{iomthemes}` are highly valued. To ensure a welcoming and inclusive community, we follow our [Contributor Code of Conduct](https://contributor-covenant.org/version/2/0/CODE_OF_CONDUCT.html). \n\nIf you have suggestions, uncover bugs, or envision new features, kindly submit an [issue on GitHub](https://github.com/iom/iomthemes/issues).\n\nTo contribute code, do not hesitate to fork the repository and create a pull request.\nNote that the package is maintained with [Fusen package](https://thinkr-open.github.io/fusen/). All functions are document in [`dev/fusen_dev.Rmd`](https://github.com/iom/iomthemes/blob/master/dev/fusen_dev.Rmd).\n\n## License\n\nThis package is distributed under the [MIT License](https://github.com/iom/iomthemes/blob/master/LICENSE.md).\n\n## Acknowledgements\n\nThis package build on the Open Source work done from many contributors. \n\nCredits goes to the work from my former colleague, [Cedric Vidonne](https://www.youtube.com/watch?v=Ypf9ngq5EQA), the main author of  `{unhcrthemes}`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiom%2Fiomthemes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiom%2Fiomthemes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiom%2Fiomthemes/lists"}