{"id":19070331,"url":"https://github.com/ropenspain/morbidityspainr","last_synced_at":"2026-06-14T23:32:28.391Z","repository":{"id":85938241,"uuid":"122175234","full_name":"rOpenSpain/MorbiditySpainR","owner":"rOpenSpain","description":null,"archived":false,"fork":false,"pushed_at":"2021-04-29T11:44:28.000Z","size":17294,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-02T15:49:56.860Z","etag":null,"topics":["microdata","morbidity","spain"],"latest_commit_sha":null,"homepage":null,"language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rOpenSpain.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-02-20T09:00:36.000Z","updated_at":"2021-04-29T11:44:30.000Z","dependencies_parsed_at":"2023-03-13T07:33:40.236Z","dependency_job_id":null,"html_url":"https://github.com/rOpenSpain/MorbiditySpainR","commit_stats":{"total_commits":42,"total_committers":3,"mean_commits":14.0,"dds":"0.16666666666666663","last_synced_commit":"308bc693212b9f6ca680bd01c4342ec9ff6e72a9"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rOpenSpain%2FMorbiditySpainR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rOpenSpain%2FMorbiditySpainR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rOpenSpain%2FMorbiditySpainR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rOpenSpain%2FMorbiditySpainR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rOpenSpain","download_url":"https://codeload.github.com/rOpenSpain/MorbiditySpainR/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240122574,"owners_count":19751142,"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":["microdata","morbidity","spain"],"created_at":"2024-11-09T01:18:09.060Z","updated_at":"2026-05-17T11:30:17.932Z","avatar_url":"https://github.com/rOpenSpain.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MorbiditySpainR\n\n[![Build Status](https://api.travis-ci.org/rOpenSpain/MorbiditySpainR.svg?branch=master)](https://travis-ci.org/rOpenSpain/MorbiditySpainR)\n\nR package to read, parse and do basic manipulation of INE Morbidity microdata [Morbilidad Hospitalaria Microdatos INE](http://www.ine.es/dyngs/INEbase/es/operacion.htm?c=Estadistica_C\u0026cid=1254736176778\u0026menu=resultados\u0026secc=1254736195291\u0026idp=1254735573175). \nThe metadata of the microdata is documented [here](http://www.ine.es/dyngs/INEbase/es/operacion.htm?c=Estadistica_C\u0026cid=1254736176778\u0026menu=resultados\u0026secc=1254736195291\u0026idp=1254735573175).\n\nThis packages uses international classification of diseases documented [here](https://eciemaps.msssi.gob.es/ecieMaps/browser/index_9_mc.html)\n\n## Installation\n\n```\nlibrary(devtools)\ninstall_github(\"rOpenSpain/MorbiditySpainR\")\n```\n\n## Downloading and reading data\n\nThe function `GetMorbiData` recives the years to read morbidity data, downloads the files from INE's ftp server and parses them.\n\n\n```\ndata \u003c- GetMorbiData(y1=2010,y2=2011)\nhead(data)\n``` \n\n## Filtering data\n\nThe function `FilterProvincia` recives the id of the _provincia_ (regional administration) to filter data.\n\n\n```\ndata \u003c- data \u003c- data_ejemplo %\u003e% FilterProvincia(28)\nhead(data)\n``` \n\nThe function `FilterEmergency` recives a boolean (defect TRUE) to filter data by wether or not is  an ER item.\n\n```\ndata \u003c- data_ejemplo %\u003e% FilterEmergency()\nhead(data)\n``` \n\nThe function `FilterDiagnosis` recives a integer (id of diagnosis) to filter data by principal diagnosis.\n\n```\ndata \u003c- data_ejemplo %\u003e% FilterDiagnosis1(2)\nhead(data)\n``` \n\nThe function `FilterDiagnosis2` recives a integer (id of diagnosis) to filter data by secondary diagnosis.\n\n```\ndata \u003c- data_ejemplo %\u003e% FilterDiagnosis2(20)\nhead(data)\n``` \n\n## Manipulating data\n\nThe function `AddDiagnosis1` add column daig1 with principal diagnosis.\n\n```\ndata \u003c- data_ejemplo %\u003e% AddDiagnosis1()\nhead(data)\n``` \n\nThe function `AddDiagnosis2` add column daig2 with secondary diagnosis.\n\n```\ndata \u003c- data_ejemplo %\u003e% AddDiagnosis2()\nhead(data)\n``` \n\nThe function `AddDiagnosis3` add column daig3 with specific diagnosis.\n\n```\ndata \u003c- data_ejemplo %\u003e% AddDiagnosis3()\nhead(data)\n``` \n\nThe function `ReduceData` does different grouping manipulations by _provincia_, date, diagnosis or sex.\n\n```\ndata \u003c- data_ejemplo %\u003e% ReduceData(provincia = TRUE,date = \"day\")\nhead(data)\n```\n\nThe function `SetPrevalence` gets relative values from grouped values and population (total or by sex) of provinces.\n\n```\ndata \u003c- data_ejemplo %\u003e%  ReduceData(provincia = TRUE,date=\"year\") %\u003e% SetPrevalence()\nhead(data)\n```\n\nNOTE: installing rJava and rlang in mac can be tricky I followed [this](https://github.com/MTFA/CohortEx/wiki/Run-rJava-with-RStudio-under-OSX-10.10,-10.11-(El-Capitan)-or-10.12-(Sierra))","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fropenspain%2Fmorbidityspainr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fropenspain%2Fmorbidityspainr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fropenspain%2Fmorbidityspainr/lists"}