{"id":16702432,"url":"https://github.com/piersyork/owidr","last_synced_at":"2025-04-10T01:10:24.971Z","repository":{"id":45550395,"uuid":"381121381","full_name":"piersyork/owidR","owner":"piersyork","description":"An R Package for Importing Data from Our World in Data","archived":false,"fork":false,"pushed_at":"2024-02-29T12:50:58.000Z","size":2787,"stargazers_count":115,"open_issues_count":5,"forks_count":11,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-10-29T19:41:47.907Z","etag":null,"topics":["data","data-visualisation","economics","r","r-package"],"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/piersyork.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-06-28T18:06:02.000Z","updated_at":"2024-05-10T23:51:04.000Z","dependencies_parsed_at":"2023-09-21T19:46:50.585Z","dependency_job_id":"35e57b2b-5e38-47d5-a7f9-7e65142b8999","html_url":"https://github.com/piersyork/owidR","commit_stats":{"total_commits":193,"total_committers":2,"mean_commits":96.5,"dds":0.005181347150259086,"last_synced_commit":"b4fa25d220e88c0fc45b38b10c370f04eade893e"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piersyork%2FowidR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piersyork%2FowidR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piersyork%2FowidR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piersyork%2FowidR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/piersyork","download_url":"https://codeload.github.com/piersyork/owidR/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248137886,"owners_count":21053775,"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":["data","data-visualisation","economics","r","r-package"],"created_at":"2024-10-12T19:04:44.702Z","updated_at":"2025-04-10T01:10:24.951Z","avatar_url":"https://github.com/piersyork.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\ntitle: \"owidR\"\noutput: github_document\nalways_allow_html: true\n---\n\n```{r, echo = FALSE, message=FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"##\",\n  fig.path = \"inst/images/\", fig.width=8.5, fig.asp=0.55, fig.align='center',\n  message = FALSE\n)\n\nlibrary(ggplot2)\n\nggplot2::theme_set(\n  theme_minimal(base_family = \"serif\") %+replace%\n    theme(text = element_text(colour = \"#373737\", size = 18),\n          plot.title = element_text(size = \"22\", hjust = 0, vjust = 3.2, face = \"bold\"),\n          plot.subtitle = element_text(hjust = 0, vjust = 3.5),\n          plot.title.position = \"plot\",\n          plot.caption.position = \"plot\",\n          plot.caption = element_text(hjust = 0, size = 14, vjust = -1),\n          legend.position = \"right\",\n          axis.text = element_text(face = \"plain\"),\n          axis.title.x = element_blank(),\n          legend.title = element_blank(),\n          panel.grid.major = element_line(linetype = \"dashed\"),\n          panel.grid.minor = element_blank(),\n          plot.margin = margin(11, 15, 8, 0),\n          axis.line.x = element_line(colour = \"#8e8e8e\"),\n          axis.ticks = element_line(colour = \"#8e8e8e\"))\n)\n\n```\n\n\u003c!-- badges: start --\u003e\n\n![CRAN downloads](http://cranlogs.r-pkg.org/badges/grand-total/owidR) [![CRAN status](https://www.r-pkg.org/badges/version/owidR)](https://CRAN.R-project.org/package=owidR) \n[![R-CMD-check](https://github.com/piersyork/owidR/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/piersyork/owidR/actions/workflows/R-CMD-check.yaml)\n\u003c!-- badges: end --\u003e\n\nThis package acts as an interface to [Our World in Data](https://ourworldindata.org/) datasets, allowing for an easy way to search through data used in over 3,000 charts and load them into the R environment.\n\n## Installation\n\nTo install from CRAN:\n\n```{r eval=FALSE}\ninstall.packages(\"owidR\")\n```\n\nTo install the development version from GitHub:\n\n```{r eval = FALSE}\ndevtools::install_github(\"piersyork/owidR\")\n```\n\n## Using the package\n\nThe main function in owidR is `owid()`, which takes a chart id and returns a data.table of the corresponding OWID dataset. To search for chart ids you can use `owid_search()` to list all the chart ids that match a keyword or regular expression.\n\n## Example\n\nLets use the core functions to get data on how human rights have changed over time. First by searching for charts on human rights.\n\n```{r example, eval = TRUE, message = FALSE}\nlibrary(owidR)\n\nowid_search(\"human rights\")\n\n```\n\nLet's use the v-dem human rights index dataset.\n\n```{r example2, eval = TRUE, message = FALSE}\n\nrights \u003c- owid(\"human-rights-index-vdem\")\n\nrights\n\n```\n\nggplot2 makes it easy to visualise our data.\n\n```{r plot}\nlibrary(ggplot2)\nlibrary(dplyr)\n\nrights |\u003e \n  filter(entity %in% c(\"United Kingdom\", \"France\", \"United States\")) |\u003e \n  ggplot(aes(year, civ_libs_vdem_owid, colour = entity)) +\n  geom_line()\n```\n\n## COVID-19 Data\n\nYou can quickly download world covid-19 data, including vaccination rates, using `owid_covid()`.\n\n```{r covid}\ncovid \u003c- owid_covid()\n\nstr(covid)\n```\n\n## To-do\n\n-   [ ] Add function to load multiple country datasets into one dataframe\n-   [ ] Add caching of data (inc. backend)\n-   [x] Remove interactive plotting to reduce dependencies\n-   [ ] Create way to import owid explorers\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiersyork%2Fowidr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpiersyork%2Fowidr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiersyork%2Fowidr/lists"}