{"id":49398755,"url":"https://github.com/miyamot0/ggsced","last_synced_at":"2026-04-28T17:05:03.537Z","repository":{"id":332361383,"uuid":"1130401889","full_name":"miyamot0/ggsced","owner":"miyamot0","description":"ggsced: A helper package for illustrating SCED using ggplot2. Specifically, ggsced is an R package designed to facilitate the drawing of cross-lagged phase changes (yes, connected ones) and other conventions expected of researchers/clinicians in using SCED in their work.","archived":false,"fork":false,"pushed_at":"2026-01-13T14:07:11.000Z","size":644,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-13T16:52:45.412Z","etag":null,"topics":["behavior-analysis","single-case-design","special-education"],"latest_commit_sha":null,"homepage":"https://www.smallnstats.com","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/miyamot0.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-08T13:05:08.000Z","updated_at":"2026-01-13T14:06:29.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/miyamot0/ggsced","commit_stats":null,"previous_names":["miyamot0/ggsced"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/miyamot0/ggsced","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miyamot0%2Fggsced","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miyamot0%2Fggsced/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miyamot0%2Fggsced/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miyamot0%2Fggsced/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/miyamot0","download_url":"https://codeload.github.com/miyamot0/ggsced/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miyamot0%2Fggsced/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32390125,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T14:34:11.604Z","status":"ssl_error","status_checked_at":"2026-04-28T14:32:37.009Z","response_time":56,"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":["behavior-analysis","single-case-design","special-education"],"created_at":"2026-04-28T17:05:02.679Z","updated_at":"2026-04-28T17:05:03.531Z","avatar_url":"https://github.com/miyamot0.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ggsced\n\n[![License: MIT](https://img.shields.io/badge/License-GPL2-blue.svg)](https://opensource.org/licenses/gpl-2-0)\n[![R package](https://img.shields.io/badge/R-package-blue.svg)](https://www.r-project.org/)\n[![Codecov test coverage](https://codecov.io/gh/miyamot0/ggsced/graph/badge.svg)](https://app.codecov.io/gh/miyamot0/ggsced)\n\n**Utilities and helpers for Single-Case Experimental Design (SCED) using ggplot2**\n\n## Overview\n\nThe `ggsced` package extends the powerful `ggplot2` visualization framework to provide specialized tools for creating high-quality graphics for Single-Case Experimental Design (SCED) research. SCED studies are a crucial methodology in behavioral and educational research, where individual participants serve as their own controls through carefully designed experimental phases. This approaches rests on careful visual inspection of data presented in graphs that clearly delineate phase changes and patterns.\n\n## Purpose\n\nSingle-case experimental designs require specific visualization conventions that are not easily achieved with standard plotting approaches. The `ggsced` package bridges the gap between the flexibility of `ggplot2` and the specific visualization needs of single-case researchers by providing:\n\n- **Professional Phase Change Lines**: Clear visual demarcation between experimental phases that meet publication standards\n- **Multiple Baseline Design Support**: Staggered intervention implementation across participants with precise phase change timing\n- **Complex Data Pattern Visualization**: Support for multiple dependent variables plotted simultaneously\n- **Publication-Ready Graphics**: APA and journal-compliant figures with consistent styling\n\n## Key Features\n\n### Core Visualization Functions\n\n- **`ggsced()`**: Primary function for adding phase change lines to existing ggplot objects\n- **`ggsced_style_x()`** and **`ggsced_style_y()`**: Styling functions for axes that follow SCED conventions with broken axis appearance\n\n### Design Pattern Support\n\n- **Multiple Baseline Designs**: Staggered intervention implementation across participants\n- **Alternating Treatment Designs**: Rapid alternation between different intervention conditions\n- **Functional Analysis Designs**: Multiple dependent variables with distinct visual markers\n- **Complex Phase Patterns**: Support for multiple intervention phases within studies\n\n### Professional Styling\n\n- **Consistent Visual Standards**: Publication-quality aesthetics with proper fonts and scaling\n- **Broken Axis Convention**: SCED-specific axis styling with disconnected x/y axes\n- **Flexible Customization**: Modular design allows adaptation to diverse research needs\n- **Multi-panel Support**: Seamless integration with `ggplot2` faceting for participant comparisons\n\n## Installation\n\n```r\n# Install from GitHub (development version)\n# install.packages(\"devtools\")\ndevtools::install_github(\"miyamot0/ggsced\")\n\n# Load the package\nlibrary(ggsced)\n```\n\n## Quick Start\n\n### Example Multiple Baseline: Gilroy et al. (2015)\n\n```r\nlibrary(ggsced)\nlibrary(tidyverse)\nlibrary(ggh4x)\n\ndata \u003c- Gilroyetal2021\n\ny_mult = .05\nx_mult = .02\n\np = ggplot(data, aes(Session, Responding,\n                     group = Condition)) +\n\n  geom_line() +\n  geom_point(size = 2.5,\n             pch = 21,\n             fill = 'black') +\n\n  geom_line(mapping = aes(Session, Reinforcers),\n            lty = 2) +\n  geom_point(mapping = aes(Session, Reinforcers),\n             size = 2.5,\n             pch = 24,\n             fill = 'white') +\n  scale_x_continuous(breaks = c(1:25),\n                     limits = c(1, 25),\n                     expand = expansion(mult = x_mult)) +\n  facet_grid2(Participant ~ .,\n              scales = \"free_y\",\n              remove_labels = \"x\",\n              axes = \"x\")  +\n  facetted_pos_scales(\n    y = list(\n      scale_y_continuous(name = \"Frequency\",\n                         breaks = c(0, 10, 20),\n                         limits = c(0, 20),\n                         expand = expansion(mult = y_mult)),\n      scale_y_continuous(name = \"Frequency\",\n                         breaks = c(0, 5, 10),\n                         limits = c(0, 10),\n                         expand = expansion(mult = y_mult)),\n      scale_y_continuous(name = \"Frequency\",\n                         breaks = c(0, 10, 20),\n                         limits = c(0, 20),\n                         expand = expansion(mult = y_mult))\n    )\n  ) +\n  theme(\n    text = element_text(size = 14,\n                        color = 'black'),\n    panel.background = element_blank(),\n    strip.background = element_blank(),\n    strip.text = element_blank()\n  ) +\n  ggsced_style_x(x_mult, lwd = 2) +\n  ggsced_style_y(y_mult, lwd = 2)\n\nsimple_facet_labels_df = ggsced_facet_labels(p, y = 20)\nsimple_facet_labels_df[2, \"Responding\"] \u003c- 10\nsimple_facet_labels_df[3, \"Responding\"] \u003c- 8\n\np \u003c- p + geom_text(data = simple_facet_labels_df,\n                   hjust = 1,\n                   vjust = 0.5,\n                   mapping = aes(label = label))\n\nsimple_condition_labels_df = ggsced_condition_labels(p)\nsimple_condition_labels_df$label = gsub(\"2\", \"\", simple_condition_labels_df$label)\n\np \u003c- p + geom_text(data = simple_condition_labels_df,\n                   mapping = aes(label = label),\n                   hjust = 0.5,\n                   vjust = 0.5)\n\n# Create extra rows for Bx Labels\nextra_labels_df \u003c- simple_condition_labels_df[1:2,]\nextra_labels_df$Session \u003c- 21.25\nextra_labels_df$x0 \u003c- 21\nextra_labels_df$x1 \u003c- 19.5\nextra_labels_df$y \u003c- 15\n\nextra_labels_df[1, \"label\"] \u003c- 'Responding'\nextra_labels_df[1, \"Responding\"] \u003c- 15\n\nextra_labels_df[2, \"label\"] \u003c- 'Reinforcers'\nextra_labels_df[2, \"Responding\"] \u003c- 5\nextra_labels_df[2, \"y\"] \u003c- 5\n\np \u003c- p + geom_text(data = extra_labels_df,\n                   mapping = aes(label = label),\n                   hjust = 0,\n                   vjust = 0.5)\n\np \u003c- p + geom_segment(data = extra_labels_df,\n                      mapping = aes(x = x0,\n                                    y,\n                                    xend = x1,\n                                    yend = y),\n                      arrow = arrow(length = unit(0.25, \"cm\")))\n\nstaggered_pls = list(\n  '1' = c(3.5,   3.5,   3.5),\n  '2' = c(6.5,   6.5,   8.5),\n  '3' = c(9.5,   9.5,  11.5),\n  '4' = c(12.5,  16.5,  16.5),\n  '5' = c(15.5,  22.5,  19.5)\n)\n\noffsets_pls = list(\n  '1' = c(F, F, F),\n  '2' = c(F, F, F),\n  '3' = c(F, F, F),\n  '4' = c(F, F, F),\n  '5' = c(T, F, F)\n)\n\nggsced(p, legs = staggered_pls, offs = offsets_pls)\n\n```\n\n![Gilroy et al. (2015) Figure](https://github.com/miyamot0/ggsced/blob/main/figs/GilroyEtAl2015.png?raw=true)\n\n### Example Augmented Multiple Baseline: Gilroy et al. (2021)\n\n```r\n\nlibrary(ggsced)\nlibrary(tidyverse)\nlibrary(ggh4x)\n\ndata \u003c- Gilroyetal2021\n\ny_mult = .05\nx_mult = .02\n\np = ggplot(data, aes(Session, Responding,\n                     group = Condition)) +\n\n  geom_line() +\n  geom_point(size = 2.5,\n             pch = 21,\n             fill = 'black') +\n\n  geom_line(mapping = aes(Session, Reinforcers),\n            lty = 2) +\n  geom_point(mapping = aes(Session, Reinforcers),\n             size = 2.5,\n             pch = 24,\n             fill = 'white') +\n  scale_x_continuous(breaks = c(1:25),\n                     limits = c(1, 25),\n                     expand = expansion(mult = x_mult)) +\n  facet_grid2(Participant ~ .,\n              scales = \"free_y\",\n              remove_labels = \"x\",\n              axes = \"x\")  +\n  facetted_pos_scales(\n    y = list(\n      scale_y_continuous(name = \"Frequency\",\n                         breaks = c(0, 10, 20),\n                         limits = c(0, 20),\n                         expand = expansion(mult = y_mult)),\n      scale_y_continuous(name = \"Frequency\",\n                         breaks = c(0, 5, 10),\n                         limits = c(0, 10),\n                         expand = expansion(mult = y_mult)),\n      scale_y_continuous(name = \"Frequency\",\n                         breaks = c(0, 10, 20),\n                         limits = c(0, 20),\n                         expand = expansion(mult = y_mult))\n    )\n  ) +\n  theme(\n    text = element_text(size = 14,\n                        color = 'black'),\n    panel.background = element_blank(),\n    strip.background = element_blank(),\n    strip.text = element_blank()\n  ) +\n  ggsced_style_x(x_mult, lwd = 2) +\n  ggsced_style_y(y_mult, lwd = 2)\n\nsimple_facet_labels_df = ggsced_facet_labels(p, y = 20)\nsimple_facet_labels_df[2, \"Responding\"] \u003c- 10\nsimple_facet_labels_df[3, \"Responding\"] \u003c- 8\n\np \u003c- p + geom_text(data = simple_facet_labels_df,\n                   hjust = 1,\n                   vjust = 0.5,\n                   mapping = aes(label = label))\n\nsimple_condition_labels_df = ggsced_condition_labels(p)\nsimple_condition_labels_df$label = gsub(\"2\", \"\", simple_condition_labels_df$label)\n\np \u003c- p + geom_text(data = simple_condition_labels_df,\n                   mapping = aes(label = label),\n                   hjust = 0.5,\n                   vjust = 0.5)\n\n# Create extra rows for Bx Labels\nextra_labels_df \u003c- simple_condition_labels_df[1:2,]\nextra_labels_df$Session \u003c- 21.25\nextra_labels_df$x0 \u003c- 21\nextra_labels_df$x1 \u003c- 19.5\nextra_labels_df$y \u003c- 15\n\nextra_labels_df[1, \"label\"] \u003c- 'Responding'\nextra_labels_df[1, \"Responding\"] \u003c- 15\n\nextra_labels_df[2, \"label\"] \u003c- 'Reinforcers'\nextra_labels_df[2, \"Responding\"] \u003c- 5\nextra_labels_df[2, \"y\"] \u003c- 5\n\np \u003c- p + geom_text(data = extra_labels_df,\n                   mapping = aes(label = label),\n                   hjust = 0,\n                   vjust = 0.5)\n\np \u003c- p + geom_segment(data = extra_labels_df,\n                      mapping = aes(x = x0,\n                                    y,\n                                    xend = x1,\n                                    yend = y),\n                      arrow = arrow(length = unit(0.25, \"cm\")))\n\nstaggered_pls = list(\n  '1' = c(3.5,   3.5,   3.5),\n  '2' = c(6.5,   6.5,   8.5),\n  '3' = c(9.5,   9.5,  11.5),\n  '4' = c(12.5,  16.5,  16.5),\n  '5' = c(15.5,  22.5,  19.5)\n)\n\noffsets_pls = list(\n  '1' = c(F, F, F),\n  '2' = c(F, F, F),\n  '3' = c(F, F, F),\n  '4' = c(F, F, F),\n  '5' = c(T, F, F)\n)\n\nggsced(p, legs = staggered_pls, offs = offsets_pls)\n\n```\n\n![Gilroy et al. (2021) Figure](https://github.com/miyamot0/ggsced/blob/main/figs/GilroyEtAl2021.png?raw=true)\n\n## Other Example Datasets\n\nThe package includes several real research datasets for learning and demonstration:\n\n- **`Gilroyetal2015`**: Multiple baseline design data\n- **`Gilroyetal2021`**: Cross-lagged Alternating Treatment Design\n\n## Documentation\n\n- **Comprehensive vignette**: Detailed examples with real research data\n- **Function documentation**: Complete help files for all exported functions\n- **Demo files**: Executable examples in the `demo/` directory\n- **Test suite**: Extensive testing to ensure reliability\n\n## Dependencies\n\n- `ggplot2`: Core plotting functionality\n- `grid`: Low-level graphics operations\n- `gtable`: Plot layout management\n- `ggh4x`: Extended ggplot2 functionality\n\n## Author and Contact\n\n**Shawn P. Gilroy, Ph.D.**  \nLouisiana State University  \n📧 [sgilroy1@lsu.edu](mailto:sgilroy1@lsu.edu)  \n🆔 ORCID: [0000-0002-1097-8366](https://orcid.org/0000-0002-1097-8366)\n\n## Bug Reports and Feature Requests\n\nIf you encounter any issues or have suggestions for improvements, please:\n\n1. **Check existing issues**: Browse the [GitHub Issues](https://github.com/miyamot0/ggsced/issues) to see if your issue has already been reported\n2. **Create a new issue**: If your issue is new, please [open a new issue](https://github.com/miyamot0/ggsced/issues/new) with:\n   - A clear, descriptive title\n   - Detailed description of the problem or feature request\n   - Minimal reproducible example (if reporting a bug)\n   - Your session info (`sessionInfo()`)\n   - Expected vs. actual behavior\n\n## License\n\nThis package is licensed under the GPL License (V2+).\n\n## Citation\n\nIf you use `ggsced` in your research, please cite it appropriately:\n\n```\nGilroy, S. P. (2026). ggsced: Utilities and helpers for Single-Case\nExperimental Design using ggplot2. R package version 0.1.0.\nhttps://github.com/miyamot0/ggsced\n```\n\n## Acknowledgments\n\nThis package was developed to support the single-case research community with publication-quality visualization tools. Special thanks to the researchers who provided data for demonstration examples and to the broader R community for the foundation provided by `ggplot2` and related packages.\n\n---\n\n**Keywords**: single-case design, SCED, behavioral research, data visualization, ggplot2, R package\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiyamot0%2Fggsced","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmiyamot0%2Fggsced","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiyamot0%2Fggsced/lists"}