{"id":38654531,"url":"https://github.com/openwashdata/waschoolpiracema","last_synced_at":"2026-01-17T09:25:38.674Z","repository":{"id":245407947,"uuid":"816813359","full_name":"openwashdata/waschoolpiracema","owner":"openwashdata","description":"Data about WASH in Schools in Piracema, Brazil","archived":false,"fork":false,"pushed_at":"2024-07-09T16:15:00.000Z","size":2151,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-07-10T20:15:06.425Z","etag":null,"topics":["brazil","opendata","openwashdata","piracema","r","sanitation","wash"],"latest_commit_sha":null,"homepage":"https://openwashdata.github.io/waschoolpiracema/","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":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-18T13:00:06.000Z","updated_at":"2024-07-09T16:15:04.000Z","dependencies_parsed_at":"2024-06-22T02:09:29.694Z","dependency_job_id":null,"html_url":"https://github.com/openwashdata/waschoolpiracema","commit_stats":null,"previous_names":["openwashdata/waschoolpiracema"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/openwashdata/waschoolpiracema","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openwashdata%2Fwaschoolpiracema","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openwashdata%2Fwaschoolpiracema/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openwashdata%2Fwaschoolpiracema/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openwashdata%2Fwaschoolpiracema/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openwashdata","download_url":"https://codeload.github.com/openwashdata/waschoolpiracema/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openwashdata%2Fwaschoolpiracema/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":["brazil","opendata","openwashdata","piracema","r","sanitation","wash"],"created_at":"2026-01-17T09:25:37.842Z","updated_at":"2026-01-17T09:25:38.650Z","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\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  message = FALSE,\n  warning = FALSE,\n  fig.retina = 2,\n  fig.align = 'center'\n)\n```\n\n# waschoolpiracema\n\n\u003c!-- badges: start --\u003e\n\n[![License: CC BY\n4.0](https://img.shields.io/badge/License-CC_BY_4.0-lightgrey.svg)](https://creativecommons.org/licenses/by/4.0/)\n[![R-CMD-check](https://github.com/openwashdata/waschoolpiracema/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/openwashdata/waschoolpiracema/actions/workflows/R-CMD-check.yaml)\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.12701107.svg)](https://zenodo.org/doi/10.5281/zenodo.12701107)\n\u003c!-- badges: end --\u003e\n\nThe goal of `waschoolpiracema` is to describe the profile of schools from the basic education system in the municipality of Piracema (Minas Gerais, Brazil). Moreover, the data compare the characteristics of schools, with a special concern to WASH, pre- (2020), peri- (2021) and post-COVID-19 pandemic (2022) to evaluate to what extend schools in Piracema made progress in providing WASH since the beginning of the COVID-19 pandemic.\n\n## Installation\n\nYou can install the development version of waschoolpiracema from\n[GitHub](https://github.com/) with:\n\n``` r\n# install.packages(\"devtools\")\ndevtools::install_github(\"openwashdata/waschoolpiracema\")\n```\n\n```{r}\n## Run the following code in console if you don't have the packages\n## install.packages(c(\"dplyr\", \"knitr\", \"readr\", \"stringr\", \"gt\", \"kableExtra\"))\nlibrary(dplyr)\nlibrary(knitr)\nlibrary(readr)\nlibrary(stringr)\nlibrary(gt)\nlibrary(kableExtra)\n```\n\nAlternatively, you can download the individual datasets 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/waschoolpiracema/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 municipality of Piracema is located in the southeast region of Brazil, in the state of Minas Gerais. Piracema is a small size city adding up to 6,700 inhabitants (IBGE, 2023). Among all Brazilian territories, it ranks as the 3,734º smallest municipality out of 5,570 and in Minas Gerais it ranks as the 492º out of 853 (IBGE, 2023). \n\nPiracema is located approximately 120 km away from the capital of its state (Belo Horizonte), and it is inaccessible by public transportation (IBGE, 2023). Piracema will be the study area for the next phase of the research (collection of primary data).\n\n```{r}\nlibrary(waschoolpiracema)\n```\n\n### waschoolpiracema\n\nThe dataset `waschoolpiracema` contains data about the water supply, the sewage disposal, the waste collection and the sanitary equipment of the schools in Piracema. It also provides information about gender, race and education levels of the school's students.\nIt has `r nrow(waschoolpiracema)` observations and `r ncol(waschoolpiracema)` variables\n\n```{r}\nwaschoolpiracema |\u003e \n  head(3) |\u003e \n  gt::gt() |\u003e\n  gt::as_raw_html()\n```\n\nFor an overview of the variable names, see the following table.\n\n```{r echo=FALSE, message=FALSE, warning=FALSE}\nreadr::read_csv(\"data-raw/dictionary.csv\") |\u003e\n  dplyr::filter(file_name == \"waschoolpiracema.rda\") |\u003e\n  dplyr::select(variable_name:description) |\u003e \n  knitr::kable() |\u003e \n  kableExtra::kable_styling(\"striped\") |\u003e \n  kableExtra::scroll_box(height = \"200px\")\n```\n\n\n## Examples\n\n```{r}\n# Load necessary libraries\nlibrary(waschoolpiracema)\nlibrary(ggplot2)\nlibrary(dplyr)\nlibrary(tidyr)\n\n# Load the dataset\nload(\"data/waschoolpiracema.rda\")\n\n# Convert admin to a factor with descriptive labels\nwaschoolpiracema$admin \u003c- factor(waschoolpiracema$admin, levels = c(1, 2, 3, 4),\n                     labels = c(\"Federal\", \"State\", \"Municipal\", \"Private\"))\n# Create the plot\nggplot(waschoolpiracema, aes(x = qt_mat_bas, y = pc_girl, color = as.factor(admin))) +\n  geom_point() +\n  labs(title = \"Percentage of Girls vs Total Number of Students per School\",\n       x = \"Total Number of Students\",\n       y = \"Percentage of Girls\",\n       color = \"Administration Type\") +\n  theme_minimal()\n\n```\n\n```{r}\n# Summarize the data to get average percentages per year\nsummary_data \u003c- waschoolpiracema %\u003e%\n  group_by(year) %\u003e%\n  summarise(avg_pc_girl = mean(pc_girl, na.rm = TRUE),\n            avg_pc_boy = mean(pc_boy, na.rm = TRUE))\n\n# Create the plot\nggplot(summary_data, aes(x = year)) +\n  geom_line(aes(y = avg_pc_girl, color = \"Girls\")) +\n  geom_line(aes(y = avg_pc_boy, color = \"Boys\")) +\n  labs(title = \"Average Percentage of Girls and Boys over the Years\",\n       x = \"Year\",\n       y = \"Average Percentage\",\n       color = \"Gender\") +\n  theme_minimal()\n```\n\n```{r}\n# List of columns related to sanitary, sewage, and waste facilities\nsanitary_sewage_waste_cols \u003c- c(\n  \"sanitary\", \"sanitary_ei\", \"sanitary_pne\", \"sanitary_funcionarios\", \"sanitary_chuveiro\",\n  \"sewage_rede_publica\", \"sewage_fossa_septica\",\n  \"waste_servico_coleta\", \"waste_queima\", \"waste_enterra\", \"waste_destino_final_publico\", \"waste_descarta_outra_area\"\n)\n\n# Convert relevant columns to integers\nwaschoolpiracema[sanitary_sewage_waste_cols] \u003c- lapply(waschoolpiracema[sanitary_sewage_waste_cols], function(x) as.integer(x))\n\n# Summarize the waschoolpiracema data to get the count and percentage of schools with facilities per year\nsummary_data \u003c- waschoolpiracema %\u003e%\n  group_by(year) %\u003e%\n  summarise(across(all_of(sanitary_sewage_waste_cols), ~ mean(.x, na.rm = TRUE))) %\u003e%\n  pivot_longer(cols = sanitary_sewage_waste_cols, names_to = \"facility\", values_to = \"percentage\")\n\n# Create the plot\nggplot(summary_data, aes(x = factor(year), y = percentage, fill = facility)) +\n  geom_bar(stat = \"identity\", position = \"dodge\") +\n  labs(title = \"Percentage of Schools with Sanitary, Sewage, and Waste Facilities by Year\",\n       x = \"Year\",\n       y = \"Percentage of Schools\",\n       fill = \"Facility Type\") +\n  theme_minimal() +\n  scale_y_continuous(labels = scales::percent)\n```\n\n```{r}\n# List of columns related to race\nrace_cols \u003c- c(\"pc_white\", \"pc_brown\", \"pc_black\", \"pc_indian\", \"pc_asian\", \"pc_nd\")\n\n# Summarize the waschoolpiracema data to get the average percentage of students per race per year\nsummary_data \u003c- waschoolpiracema %\u003e%\n  group_by(year) %\u003e%\n  summarise(across(all_of(race_cols), ~ mean(.x, na.rm = TRUE))) %\u003e%\n  pivot_longer(cols = race_cols, names_to = \"race\", values_to = \"percentage\")\n\n# Create the line plot\nggplot(summary_data, aes(x = factor(year), y = percentage, color = race, group = race)) +\n  geom_line(size = 1.2) +\n  geom_point(size = 3) +\n  labs(title = \"Evolution of Racial Composition of Students Over the Years\",\n       x = \"Year\",\n       y = \"Average Percentage of Students\",\n       color = \"Race\") +\n  theme_bw() +  # Use a different theme for better visualization\n  theme(\n    plot.title = element_text(hjust = 0.5, size = 16, face = \"bold\"),\n    axis.title = element_text(size = 14),\n    axis.text = element_text(size = 12),\n    legend.title = element_text(size = 14),\n    legend.text = element_text(size = 12)\n  ) +\n  scale_color_brewer(palette = \"Set1\")\n\n```\n\n```{r}\nwater_cols \u003c- c(\"drink_water\", \"public_water\", \"borehole_water\", \"well_water\", \"surface_water\", \"no_water\")\n\n# Convert relevant columns to integers\nwaschoolpiracema[water_cols] \u003c- lapply(waschoolpiracema[water_cols], function(x) as.integer((x)))\n\n# Summarize the data to get the count and percentage of schools with each type of water supply per year\nsummary_data \u003c- waschoolpiracema %\u003e%\n  group_by(year) %\u003e%\n  summarise(across(all_of(water_cols), ~ sum(.x, na.rm = TRUE))) %\u003e%\n  pivot_longer(cols = water_cols, names_to = \"water_supply\", values_to = \"count\")\n\n# Create the stacked bar plot\nggplot(summary_data, aes(x = factor(year), y = count, fill = water_supply)) +\n  geom_bar(stat = \"identity\") +\n  labs(title = \"Distribution of Water Supply Types in Schools Over the Years\",\n       x = \"Year\",\n       y = \"Number of Schools\",\n       fill = \"Water Supply Type\") +\n  theme_minimal() +\n  theme(\n    plot.title = element_text(hjust = 0.5, size = 16, face = \"bold\"),\n    axis.title = element_text(size = 14),\n    axis.text = element_text(size = 12),\n    legend.title = element_text(size = 14),\n    legend.text = element_text(size = 12)\n  ) +\n  scale_fill_brewer(palette = \"Set3\")\n\n\n```\n\n## Capstone Project\n\nThis dataset is shared as part of a capstone project in [Data Science for openwashdata](https://ds4owd-001.github.io/website/). For more information about the project and to explore further insights, please visit the project page at https://ds4owd-001.github.io/project-poaguek/ (to be public available)\n\nThis study is a sub-project of a PhD project. It is also an initial study comparing the BNSC from 2020 and 2021(#TODO: add reference). Findings will be essential for the next phase of the research, which will be the collection of primary data in schools in the municipality of Piracema through qualitative methods (interviews, on-spot observations and art-based research).\n\n## License\n\nData are available as\n[CC-BY](https://github.com/openwashdata/waschoolpiracema/blob/main/LICENSE.md).\n\n## Citation\n\nPlease cite this package using:\n\n```{r}\ncitation(\"waschoolpiracema\")\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenwashdata%2Fwaschoolpiracema","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenwashdata%2Fwaschoolpiracema","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenwashdata%2Fwaschoolpiracema/lists"}