{"id":16284677,"url":"https://github.com/pachadotdev/freedomhouse","last_synced_at":"2026-01-04T01:08:19.390Z","repository":{"id":173481219,"uuid":"650814111","full_name":"pachadotdev/freedomhouse","owner":"pachadotdev","description":"The goal of freedom is to ease the usage of the Freedom in the World dataset from Freedom House in R. The Freedom in the World dataset is updated annually and is originally available for download in Excel format.","archived":false,"fork":false,"pushed_at":"2024-09-12T18:00:32.000Z","size":129944,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-28T22:41:08.923Z","etag":null,"topics":["freedom","nlp","r"],"latest_commit_sha":null,"homepage":"https://pacha.dev/freedomhouse/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pachadotdev.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":".github/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":"2023-06-07T21:41:20.000Z","updated_at":"2024-09-12T18:00:35.000Z","dependencies_parsed_at":"2024-09-13T05:01:32.562Z","dependency_job_id":null,"html_url":"https://github.com/pachadotdev/freedomhouse","commit_stats":null,"previous_names":["pachadotdev/freedom"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pachadotdev%2Ffreedomhouse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pachadotdev%2Ffreedomhouse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pachadotdev%2Ffreedomhouse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pachadotdev%2Ffreedomhouse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pachadotdev","download_url":"https://codeload.github.com/pachadotdev/freedomhouse/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244043307,"owners_count":20388561,"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":["freedom","nlp","r"],"created_at":"2024-10-10T19:20:25.861Z","updated_at":"2026-01-04T01:08:19.354Z","avatar_url":"https://github.com/pachadotdev.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  out.width = \"100%\"\n)\n```\n\n# Freedom House Datasets in R \u003cimg src=\"man/figures/logo.svg\" align=\"right\" height=\"139\" alt=\"\" /\u003e\n\n\u003c!-- badges: start --\u003e\n\u003c!-- badges: end --\u003e\n\nThe goal of freedomhouse is to ease the usage of the Freedom in the World\ndataset from Freedom House in R. The Freedom in the World dataset is updated\nannually and is originally available for download in Excel format.\n\nFreedom House is best known for political advocacy surrounding issues of \nDemocracy, Political Freedom, and Human Rights. Each of these issues trascends\npolitical colours. The Freedom in the World dataset is a comprehensive and\nwidely used measure of political freedom. It is used by academics, journalists,\nand policy makers alike.\n\nMy added value is to presents all the tables in a really simple to use format\nand to make all the texts with the justifications for each sub-item scores,\nthat you find in around 1,000 links of the form \nhttps://freedomhouse.org/country/canada/freedom-world/2023, available in a\nsingle tidy table. This is useful for text mining and sentiment analysis.\n\nI provided an Excel version of the final result in addition to the R datasets.\nIt can be downloaded [here](https://github.com/pachadotdev/freedomhouse/raw/main/exported-spreadsheets/freedom-house-excel.zip).\n\nAnother addition of mine was is to add translations. This work is not\naffiliated with Freedom House.\n\n## Installation\n\nYou can install the development version of freedom from [GitHub](https://github.com/) with:\n\n``` r\n# install.packages(\"remotes\")\nremotes::install_github(\"pachadotdev/freedomhouse\")\n```\n\nTo install a translation, such as the Spanish translation, you can use:\n\n```r\nremotes::install_github(\"pachadotdev/freedomhouse\", subdir = \"translations/es\")\n```\n\n## Example\n\nThis is a basic example which shows you how to use the available three tables.\n\n```{r example, warning=FALSE, message=FALSE}\nlibrary(dplyr)\nlibrary(freedomhouse)\n\n# Search Canada in 2023\ncountry_rating_status %\u003e%\n  filter(country == \"Canada\", year == 2023)\n\n# Search for the \"trade union\" sub item score for Canada\ncountry_score %\u003e%\n  filter(country == \"Canada\", year == 2023) %\u003e%\n  filter(grepl(\"trade union\", sub_item_description)) %\u003e%\n  select(sub_item_description)\n\n# Get the full description of the \"trade union\" sub-item\ncountry_score %\u003e%\n  filter(sub_item == \"E3\") %\u003e%\n  distinct(sub_item_description)\n\n# Get the justification for the score on sub item E3\ncountry_rating_text %\u003e%\n  filter(\n    iso3c == \"CAN\",\n    year == 2023,\n    sub_item == \"E3\"\n  ) %\u003e%\n  pull(detail)\n```\n\n## Shiny\n\nThere is an example with Shiny [here](https://github.com/pachadotdev/freedomhouse/tree/main/shiny-demo).\n\n## Translations\n\n### Templates in Excel\n\nThe directory `dev/texts` contains the Excel files that I used for the\ntranslations in `dev/texts/translation_es`. These can be used as templates for\ntranslations to other languages different from Spanish.\n\nWhat I did to add the translations in R was to use the `left_join` function\nfrom the `dplyr` package to match each country/item/sub-item with the\ncorresponding translation.\n\n### Spanish\n\nReplica del ejemplo anterior.\n\n```r\n# remotes::install_github(\"pachadotdev/freedomhouse\", subdir = \"translations/es\")\nlibrary(dplyr)\nlibrary(freedomhouse)\n\nestado_calificacion_pais %\u003e%\n  filter(pais == \"Canadá\", anio == 2023)\n\n# # A tibble: 1 × 9\n#    anio pais   iso2c iso3c continente derechos_politicos libertades_civiles\n#   \u003cint\u003e \u003cfct\u003e  \u003cfct\u003e \u003cfct\u003e \u003cfct\u003e                   \u003cint\u003e              \u003cint\u003e\n# 1  2023 Canadá CA    CAN   Américas                    1                  1\n# # ℹ 2 more variables: estado \u003cfct\u003e, color \u003cfct\u003e\n\npuntaje_pais %\u003e%\n  filter(pais == \"Canadá\", anio == 2023) %\u003e%\n  filter(grepl(\"sindicato\", descripcion_sub_categoria)) %\u003e%\n  select(sub_categoria)\n\n# # A tibble: 1 × 1\n#   sub_categoria\n#   \u003cchr\u003e        \n# 1 E3\n\npuntaje_pais %\u003e%\n  filter(sub_categoria == \"E3\") %\u003e%\n  distinct(descripcion_sub_categoria)\n\n# # A tibble: 1 × 1\n#   descripcion_sub_categoria                                                     \n#   \u003cchr\u003e                                                                         \n# 1 ¿Existe libertad para los sindicatos y organizaciones profesionales o laboral…\n\n# Get the justification for the score on sub item E3\ntexto_calificacion_pais %\u003e%\n  filter(\n    iso3c == \"CAN\",\n    anio == 2023,\n    sub_categoria == \"E3\"\n  ) %\u003e%\n  pull(detalle)\n\n# [1] Los sindicatos y las asociaciones empresariales gozan de un alto nivel de afiliación y están bien organizados.\n# 27269 Levels: La calificación de derechos políticos de Afganistán mejoró de 6 a 5 debido a una mayor actividad política de la oposición antes de las elecciones programadas, así como a modestos avances en la transparencia del gobierno. ...\n```\n\n## Development\n\nTo verify the changes made to the package, run the following commands:\n\n```r\ndevtools::document()\nattachment::att_amend_desc()\ndevtools::check()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpachadotdev%2Ffreedomhouse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpachadotdev%2Ffreedomhouse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpachadotdev%2Ffreedomhouse/lists"}