To Obtain and Analyze Sex-disaggregated Datasets
sexDisaggregate
is an R package that separates CSV datasets by sex,
performs comparison visualization and helps users to examine their
datasets from a sex-disaggregated perspective.
To install the latest version of the package:
require("devtools")
devtools::install_github("lifangy6/sexDisaggregate", build_vignettes = TRUE)
library("sexDisaggregate")
To run the shinyApp:
sexDisaggregate::runSexDisaggregate()
To have a glance of the package:
ls("package:sexDisaggregate")
data(package = "sexDisaggregate")
browseVignettes("sexDisaggregate")
sexDisaggregate
contains 2 functions:
Function separateCSV
separates provided CSV file into 3 new versions:
cleaned both-sex dataframe, female-only dataframe and male-only
dataframe.
Function visualizeDiff
visualize 4 graphs that show sex percentage and
specific category vs. sex in the dataset.
The author of the package is Fangyi Li.
-
Package
ggplot2
is used to create plots in functionvisualizeDiff
. -
Package
cowplot
is used to comnine plots in functionvisualizeDiff
. -
Package
shiny
is used to develop shinyApp of the package.
-
Chang W, Cheng J, Allaire J, Sievert C, Schloerke B, Xie Y, Allen J, McPherson J, ipert A, Borges B (2022). shiny: Web Application Framework for R. R package version 1.7.3, https://CRAN.R-project.org/package=shiny.
-
Claus O. Wilke (2017). cowplot: Streamlined Plot Theme and Plot Annotations for ‘ggplot2’. https://github.com/wilkelab/cowplot.
-
Heinemann, A., Martinez, V. M., & Alas, C. R. (n.d.). Why we need more sex-disaggregated Social Protection Data and what we’re doing to get there. World Bank Blogs. Retrieved November 14, 2022, from https://blogs.worldbank.org/opendata/why-we-need-more-sex-disaggregated-social-protection-data-and-what-were-doing-get-there
-
R Core Team (2022). R: A language and environment for statistical computing. R Foundation for Statistical Computing, Vienna, Austria. https://www.R-project.org/.
-
Wickham, H. and Bryan, J. (2019). R Packages (2nd edition). Newton, Massachusetts: O’Reilly Media. https://r-pkgs.org/
-
Wickham H (2016). ggplot2: Elegant Graphics for Data Analysis. Springer-Verlag New York. ISBN 978-3-319-24277-4, https://ggplot2.tidyverse.org.
-
Silva, Anjali. “Anjalisilva/TestingPackage: A Simple R Package Illustrating Components of an R Package: 2019-2022 BCB410H - Applied Bioinformatics, University of Toronto, Canada.” GitHub, https://github.com/anjalisilva/TestingPackage.
This package was developed as part of an assessment for 2022 BCB410H:
Applied Bioinformatics course at the University of Toronto, Toronto,
CANADA. sexDisaggregate
welcomes issues, enhancement requests, and
other contributions. To submit an issue, use the GitHub
issues. Many thanks
to those who provided feedback to improve this package.
- sexDisaggregate
|- sexDisaggregate.Rproj
|- DESCRIPTION
|- NAMESPACE
|- LICENSE
|- README
|- inst
CITATION
|- extdata
|- example_data.csv
|- example_barplot.png
|- example_densityplot.png
|- Overview.jpg
|- shiny-scripts
|- app.R
|- man
|- separateCSV.Rd
|- visualizeDiff.Rd
|- runSexDisaggregate.Rd
|- R
|- separateCSV.R
|- visualizeDiff.R
|- runSexDisaggregate.R
|- vignettes
|- Introduction_sexDisaggregate.Rmd
|- example_barplot.png
|- example_densityplot.png
|- shiny_example.png
|- tests
|- testthat.R
|- testthat
|- test-separateCSV.R
|- test-visualizeDiff.R
Step 1. Separate example dataset
exampleDataPath <- system.file("extdata", "example_data.csv", package = "sexDisaggregate")
dataList <- sexDisaggregate::separateCSV(filepath = exampleDataPath, sexTag = "Sex", femaleTag = "F", maleTag = "M")
dataList
Step 2.1: Bar plot approach
plots1 <- visualizeDiff(dataList = dataList, yTag = "Asthma", visMethod = "Bar")
plots1