{"id":30864957,"url":"https://github.com/epiforecasts/contactsurveys","last_synced_at":"2025-09-07T20:18:59.462Z","repository":{"id":307037823,"uuid":"1027499921","full_name":"epiforecasts/contactsurveys","owner":"epiforecasts","description":"Download and access social contact data","archived":false,"fork":false,"pushed_at":"2025-09-02T08:31:04.000Z","size":1399,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-02T08:43:37.223Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://epiforecasts.io/contactsurveys/","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/epiforecasts.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","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,"zenodo":null}},"created_at":"2025-07-28T05:33:53.000Z","updated_at":"2025-09-02T08:13:03.000Z","dependencies_parsed_at":"2025-08-15T02:19:39.675Z","dependency_job_id":"3565a85b-90cb-4be7-9e07-f361c6b753b3","html_url":"https://github.com/epiforecasts/contactsurveys","commit_stats":null,"previous_names":["njtierney/contactsurveys","epiforecasts/contactsurveys"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/epiforecasts/contactsurveys","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epiforecasts%2Fcontactsurveys","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epiforecasts%2Fcontactsurveys/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epiforecasts%2Fcontactsurveys/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epiforecasts%2Fcontactsurveys/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/epiforecasts","download_url":"https://codeload.github.com/epiforecasts/contactsurveys/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epiforecasts%2Fcontactsurveys/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274088646,"owners_count":25220262,"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-09-07T02:00:09.463Z","response_time":67,"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":[],"created_at":"2025-09-07T20:18:54.618Z","updated_at":"2025-09-07T20:18:59.456Z","avatar_url":"https://github.com/epiforecasts.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n# contactsurveys\n\n\u003c!-- badges: start --\u003e\n[![R-CMD-check](https://github.com/epiforecasts/contactsurveys/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/epiforecasts/contactsurveys/actions/workflows/R-CMD-check.yaml)\n[![Codecov test\ncoverage](https://codecov.io/gh/epiforecasts/contactsurveys/graph/badge.svg)](https://app.codecov.io/gh/epiforecasts/contactsurveys)\n\u003c!-- badges: end --\u003e\n\n`contactsurveys` is an `R` package to download contact survey data, which can be used to derive social mixing matrices (see, for example, the [socialmixr](https://github.com/epiforecasts/socialmixr) package). This code was initially in the socialmixr package, but the code for downloading surveys has been moved into this package.\n\n# Installation\n\nThe development version can be installed using `remotes`\n\n```r\nremotes::install_github(\"epiforecasts/contactsurveys\")\n```\n\n# Example usage\n\n```{r setup}\nlibrary(contactsurveys)\n```\n\n`contactsurveys` provides access to all surveys in the [Social contact data](https://zenodo.org/communities/social_contact_data) community on [Zenodo](https://zenodo.org). \n\n## Listing surveys\n\nThe available surveys can be listed (if an internet connection is available) with `list_surveys()`\n\n```{r}\nsocial_contact_surveys \u003c- list_surveys(verbose = FALSE)\ndim(social_contact_surveys)\nhead(social_contact_surveys)\n```\n\nBy default, the survey data from `list_surveys()` is effectively cached, so it will run very quickly the next time you run it. See `?list_surveys()` for more detail.\n\n## Downloading surveys\n\nSurveys can be downloaded using `download_survey()`. This will get the relevant data of a survey given its Zenodo DOI (as returned by `list_surveys()`). \n\n```{r}\npolymod_doi \u003c- \"https://doi.org/10.5281/zenodo.3874557\"\npolymod_survey_files \u003c- download_survey(polymod_doi, verbose = FALSE)\npolymod_survey_files\n```\n\n## Getting citations\n\nA reference for any given survey can be obtained by passing a DOI to `get_citation()`:\n\n```{r}\nget_citation(polymod_doi, verbose = FALSE)\n```\n\n## Using contact matrices with socialmixr\n\nYou can then use the survey files downloaded with functions from [socialmixr](https://github.com/epiforecasts/socialmixr), `load_survey()` and `contact_matrix()`.\n\n```{r}\nlibrary(socialmixr)\npolymod_loaded \u003c- load_survey(polymod_survey_files)\nuk_contact_matrix \u003c- contact_matrix(\n      polymod_loaded,\n      countries = \"United Kingdom\",\n      age.limits = c(0, 18, 65)\n    )\n\nuk_contact_matrix\n```\n\n## Contributors\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\nAll contributions to this project are gratefully acknowledged using the [`allcontributors` package](https://github.com/ropensci/allcontributors) following the [allcontributors](https://allcontributors.org) specification. Contributions of any kind are welcome!\n\n### Code\n\n\n\u003ca href=\"https://github.com/epiforecasts/contactsurveys/commits?author=sbfnk\"\u003esbfnk\u003c/a\u003e, \n\u003ca href=\"https://github.com/epiforecasts/contactsurveys/commits?author=Bisaloo\"\u003eBisaloo\u003c/a\u003e, \n\u003ca href=\"https://github.com/epiforecasts/contactsurveys/commits?author=njtierney\"\u003enjtierney\u003c/a\u003e, \n\u003ca href=\"https://github.com/epiforecasts/contactsurveys/commits?author=lwillem\"\u003elwillem\u003c/a\u003e, \n\u003ca href=\"https://github.com/epiforecasts/contactsurveys/commits?author=Degoot-AM\"\u003eDegoot-AM\u003c/a\u003e, \n\u003ca href=\"https://github.com/epiforecasts/contactsurveys/commits?author=jarvisc1\"\u003ejarvisc1\u003c/a\u003e, \n\u003ca href=\"https://github.com/epiforecasts/contactsurveys/commits?author=alxsrobert\"\u003ealxsrobert\u003c/a\u003e\n\n\n\n### Issues\n\n\n\u003ca href=\"https://github.com/epiforecasts/contactsurveys/issues?q=is%3Aissue+author%3Aavallecam\"\u003eavallecam\u003c/a\u003e\n\n\n\u003c!-- markdownlint-enable --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fepiforecasts%2Fcontactsurveys","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fepiforecasts%2Fcontactsurveys","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fepiforecasts%2Fcontactsurveys/lists"}