Plot Function for Single-Case Data Frames
Overview
Add-on for the 'scan' package that creates plots from single-case data frames ('scdf'). It includes functions for styling single-case plots, adding phase-based lines to indicate various statistical parameters, and predefined themes for presentations and publications. More information and in depth examples can be found in the online book "Analyzing Single-Case Data with R and 'scan" Jürgen Wilbert (2026) https://jazznbass.github.io/scan-Book/.
Bug fixes
- Fixed bug that did not allow to set pvar to something else than "phase" and add a statline at the same time.
New function
split_dataline(): This function allows to split the dataline of a treatment phase into two parts based on a treatment variable in a dataset. This is mainly used to visualize alternating treatments in a phase (e.g. alternating treatments in a B phase).
```r
scplot(scan::example_atd) |>
split_dataline("treatment")
```
New features / arguments
- set_dataline(): new argument "show_gaps". Logical. If TRUE, missing values in the data will result in gaps in the line. If FALSE, missing values will be ignored and the line will be drawn continuously.
- Improved the automatic naming of statlines when the phase argument is set. (e.g. "mean", phase = "A" now creates a statline with the name "mean values A").
- Themes that have been created with *scplot* prior version 0.6.2 (including 0.6.1) must be recreated by executing the respective functions due to the adoption to S7 classes.
Show all changes in 0.7.0Hide the rest of the changes in 0.7.0
- add_statline(): trends can now be plotted for any phase or phase combination.
- add_statline(): Four regression methods now apply to all trend settings.
- add_stalline(): phase = "all" calculates a statistic for all values.
- New argument
segmentedfor add_statline to indicate if there is a gap in the statline between phases. - New argument
casespecifying for which cases a statline should be added. - New experimental option to include staircase style phase separators that go across plots
```
scplot(exampleA1B1A2B2) |>
scplot::set_theme("basic", "tiny", "staircase") |>
set_yaxis(c(NA,50))
scplot(exampleABC) |>
set_separator(staircase = TRUE, linewidth = 2, linetype = "solid")
```
Multiple new themes:
'clarity', 'journal', 'poster', 'handout', 'sparse','midnight', 'playful', 'atelier', 'bauhaus', 'sienna'
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-04
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-06-09
- ERROR12 OK, 1 ERROR2026-06-08
- OK13 OK2026-05-09
Show 2 earlier changesHide 2 earlier changes
- WARNING12 OK, 1 WARNING2026-05-06
- OK14 OK2026-03-10
Documentation
- Help pages
- 39 (10 internal)includes a package overview page
- Examples that run
- 93%13 run in a plain check · 1 never run
- Exported functions with examples
- 42%
- Documented parameters
- 97%
- Return-value docs
- 92%
- Help pages citing references
- 0%
Downloads
Dependencies
Installing scplot adds 121 packages (60 with compiled code, 99 MB of source tarballs). Heaviest: stringi 11 MB, ggplot2 6.0 MB, bslib 5.6 MB.
Code & Tests
People & History
Package metadata
- First published
- 2023-03-21
- Total releases
- 9 / 3 yrs
- License
- GPL (>= 3) OSI
- Minimum R
- ≥ 4.1.0
- Download size
- 79 KB
Cite
Cite this package
Run in R for the authors' entry:
citation("scplot")The package provides a citation file, so citation() returns the authors' own entry.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-22, which the citation names so these numbers can be found later. More on citing and the projects behind them.