{"id":38654552,"url":"https://github.com/openwashdata/wsabrazil","last_synced_at":"2026-01-17T09:25:39.074Z","repository":{"id":229866165,"uuid":"777854571","full_name":"openwashdata/wsabrazil","owner":"openwashdata","description":"This dataset about wastewater management and household infrastructure from various Brazilian regions provides insights into wastewater disposal habits, water sources, bathroom facilities, and sanitation infrastructure.","archived":false,"fork":false,"pushed_at":"2024-11-27T10:48:34.000Z","size":52734,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-05T00:10:36.837Z","etag":null,"topics":["2010","brazil","infrastructure","open-data","r","sanitation","wash","wastewater","water"],"latest_commit_sha":null,"homepage":"https://openwashdata.github.io/wsabrazil/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc-by-4.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openwashdata.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-03-26T16:17:09.000Z","updated_at":"2024-11-27T10:53:57.000Z","dependencies_parsed_at":"2025-04-12T18:08:00.403Z","dependency_job_id":"7ce7d15e-28d4-4737-9c65-844eafe552fd","html_url":"https://github.com/openwashdata/wsabrazil","commit_stats":null,"previous_names":["openwashdata/wsabrazil"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/openwashdata/wsabrazil","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openwashdata%2Fwsabrazil","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openwashdata%2Fwsabrazil/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openwashdata%2Fwsabrazil/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openwashdata%2Fwsabrazil/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openwashdata","download_url":"https://codeload.github.com/openwashdata/wsabrazil/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openwashdata%2Fwsabrazil/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28505550,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T06:57:29.758Z","status":"ssl_error","status_checked_at":"2026-01-17T06:56:03.931Z","response_time":85,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["2010","brazil","infrastructure","open-data","r","sanitation","wash","wastewater","water"],"created_at":"2026-01-17T09:25:38.927Z","updated_at":"2026-01-17T09:25:39.029Z","avatar_url":"https://github.com/openwashdata.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\nalways_allow_html: true\neditor_options: \n  markdown: \n    wrap: 72\n  chunk_output_type: console\nbibliography: references.bib\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\nlibrary(tidyverse)\n```\n\n# wsabrazil\n\n\u003c!-- badges: start --\u003e\n[![License: CC BY 4.0](https://img.shields.io/badge/License-CC_BY_4.0-darkorange.svg)](https://creativecommons.org/licenses/by/4.0/)\n[![R-CMD-check](https://github.com/openwashdata/wsabrazil/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/openwashdata/wsabrazil/actions/workflows/R-CMD-check.yaml)\n\u003c!-- badges: end --\u003e\n\nThis package contains information related to wastewater management practices and household infrastructure in Brazil. It includes variables such as sector codes, metropolitan region names, municipality codes, and names, as well as data on the location type, living conditions, average income, and household amenities. The data provides insights into wastewater disposal habits, water supply sources, bathroom facilities, and sanitation infrastructure in Brazilian households, contributing to understanding environmental sustainability and infrastructure development efforts. @atlas\n![](man/figures/Rplot04.png)\nBased on the data, it appears for example that most of the municipalities exhibits poor housing conditions. In this dataset, housing conditions are represented numerically, with '1' indicating correct housing conditions and '0' indicating poor housing conditions. The location map displays all Brazilian municipalities from which data has been collected.\n\n## Installation\n\nYou can install the development version of wsabrazil from [GitHub](https://github.com/) with:\n\n```r\n# install.packages(\"devtools\")\ndevtools::install_github(\"openwashdata/wsabrazil\")\n```\n\nAlternatively, you can download the dataset as a CSV or XLSX\nfile from the table below.\n\n```{r, echo=FALSE, message=FALSE, warning=FALSE}\n\nextdata_path \u003c- \"https://github.com/openwashdata/wsabrazil/raw/main/inst/extdata/\"\n\nread_csv(\"data-raw/dictionary.csv\") |\u003e \n  distinct(file_name) |\u003e \n  dplyr::mutate(file_name = str_remove(file_name, \".rda\")) |\u003e \n  dplyr::rename(dataset = file_name) |\u003e \n  mutate(\n    CSV = paste0(\"[Download CSV](\", extdata_path, dataset, \".csv)\"),\n    XLSX = paste0(\"[Download XLSX](\", extdata_path, dataset, \".xlsx)\")\n  ) |\u003e \n  knitr::kable()\n\n```\n\n## Data\n\nThe dataset includes observations of wastewater management practices and household infrastructure (access to water and sanitation services) across various regions in Brazil.\n\nThe package provides access to one single dataset.\n\n```{r, echo = TRUE}\nlibrary(wsabrazil)\n```\n\nThe `wsabrazil` dataset has `r ncol(wsabrazil)`\nvariables and `r nrow(wsabrazil)` observations. For an overview\nof the variable names, see the following table.\n\n```{r, eval=FALSE}\nwsabrazil\n```\n\n```{r, echo=FALSE, message=FALSE, warning=FALSE}\nreadr::read_csv(\"data-raw/dictionary.csv\") |\u003e \n  dplyr::filter(file_name == \"wsabrazil.rda\") |\u003e \n  dplyr::select(variable_name:description) |\u003e \n  knitr::kable() |\u003e \n  kableExtra::kable_styling() |\u003e \n  kableExtra::scroll_box(height = \"400px\")\n```\n\n## Examples\n\n### 1. Housing conditions across municipalities\n\nThe location map displayed above was created as follows:\n\n```{r eval=FALSE, message=FALSE, warning=FALSE, include=TRUE, paged.print=FALSE}\nlibrary(wsabrazil)\nlibrary(ggplot2)\nlibrary(sf)\nlibrary(dplyr)\n\nshapefile \u003c- st_read(\"man/gadm41_BRA_2.json\")\nmerged_data \u003c- merge(shapefile, wsabrazil, by.x = \"CC_2\", by.y = \"municipality_code\")\n\n# Plot the choropleth map\nggplot() +\n  geom_sf(data = merged_data, aes(fill = as.factor(sector_type))) +\n  scale_fill_manual(name = \"sector_type\", values = c(\"0\" = \"#E69F00\", \"1\" = \"#0072B2\"),\n                    labels = c(\"0\" = \"poor\", \"1\" = \"correct\")) +\n  labs(title = \"Housing conditions across municipalities\") +\n  theme(plot.title = element_text(hjust = 0.5, face = \"bold\", color = \"#333333\", size = 24),\n        legend.title = element_text(face = \"bold\", color = \"#333333\", size = 16),\n        legend.text = element_text(color = \"#333333\", size = 16))\n```\n\n### 2. Water supply in Brazil\n\nFrom the dataset, we can also explore the distribution of water sources in the whole country. We create here a horizontal bar plot to visualize the frequency of different water sources available, utilizing variables such as piped water or stored rainwater. We observe from the resulting plot (see Figure below) that the majority of private households are supplied by piped water. Interestingly, almost none of the households store rainwater. This is possibly due to factors such as local climate patterns and infrastructure limitations.\n\n```{r, eval=FALSE}\nlibrary(dplyr)\nlibrary(ggplot2)\nlibrary(wsabrazil)\nlibrary(tidyr)\n\ndata_long_summary \u003c- wsabrazil |\u003e \n  pivot_longer(cols = piped_water:other_water_source, \n                      names_to = \"water_source\", \n                      values_to = \"frequency\") |\u003e \n  group_by(water_source) |\u003e \n  summarise(total_frequency = sum(frequency, na.rm = TRUE)) |\u003e \n  arrange(total_frequency)\n\n# Create a horizontal bar plot of water source types\nplot \u003c- ggplot(data_long_summary, aes(x = total_frequency, y = reorder(water_source, total_frequency))) +\n  geom_col(fill = \"#0072B2\") +\n  labs(x = \"Frequency\", y = \"Water Source\", \n       title = \"Water supply in Brazil\", \n       caption = \"\") +\n  theme(plot.title = element_text(hjust = 0.5, face = \"bold\", color = \"#333333\"))\n\nplot + scale_x_continuous(labels = scales::number_format())\n\n```\n\n![](man/figures/Rplot01.png)\n\n## License\n\nData are available as \n[CC-BY](https://github.com/openwashdata/wsabrazil/LICENSE.md).\n\n## Citation\n\nTo cite this package, please use:\n\n```{r}\ncitation(\"wsabrazil\")\n```\n\n## References\n\n```{html, echo = FALSE}\n\u003cdiv id=\"refs\"\u003e\u003c/div\u003e\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenwashdata%2Fwsabrazil","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenwashdata%2Fwsabrazil","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenwashdata%2Fwsabrazil/lists"}