Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Runs R CMD check --as-cran across the standard CRAN platform matrix on every
# push and PR targeting main/master only. Dev-side checks are run manually
# by the maintainer; CI gates only the final mile into master.

on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: R-CMD-check.yaml

permissions: read-all

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'release'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
args: 'c("--no-manual", "--as-cran")'
369 changes: 161 additions & 208 deletions ARCHITECTURE.md

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
Package: panelView
Type: Package
Title: Visualizing Panel Data
Version: 1.2.1
Date: 2026-03-20
Version: 1.3.1
Date: 2026-05-13
Authors@R:
c(person("Yiqing", "Xu", ,"yiqingxu@stanford.edu", role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-2041-6671")),
person("Hongyu", "Mou", , "hongyumou@g.ucla.edu", role = c("aut")),
person("Licheng", "Liu", ,"liulch@mit.edu", role = c("aut")))
Maintainer: Yiqing Xu <yiqingxu@stanford.edu>
Description: Visualizes panel data. It has three main functionalities: (1) it plots the treatment status and missing values in a panel dataset; (2) it visualizes the temporal dynamics of a main variable of interest; (3) it depicts the bivariate relationships between a treatment variable and an outcome variable either by unit or in aggregate. For details, see <doi:10.18637/jss.v107.i07>.
Description: Visualizes panel data. It has four main functionalities: (1) it plots the treatment status and missing values in a panel dataset; (2) it visualizes the temporal dynamics of a main variable of interest; (3) it depicts the bivariate relationships between a treatment variable and an outcome variable either by unit or in aggregate; (4) it displays the network structure of multi-way fixed effects as a k-partite graph, identifying connected components, singletons, and duplicate observations. For details, see <doi:10.18637/jss.v107.i07>.
URL: https://yiqingxu.org/packages/panelview/, https://github.com/xuyiqing/panelView
BugReports: https://github.com/xuyiqing/panelView/issues
License: MIT + file LICENSE
Imports: ggplot2 (>= 3.4.0), gridExtra, grid, dplyr (>= 1.0.0)
Depends: R (>= 2.10)
Encoding: UTF-8
Suggests: testthat (>= 3.0.0)
Suggests: testthat (>= 3.0.0), igraph
RoxygenNote: 7.3.2
LazyData: true
Config/testthat/edition: 3
Expand Down
5 changes: 4 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
##useDynLib(panelView)
##exportPattern("^[[:alpha:]]+")
importFrom("stats", "na.omit", "sd", "var", "ave", "aggregate", "approxfun")
importFrom("stats", "na.omit", "sd", "var", "ave", "aggregate", "approxfun",
"setNames")
importFrom("ggplot2", "geom_boxplot", "geom_density", "geom_tile",
"geom_point","geom_col", "labs", "theme_bw", "scale_fill_manual",
"geom_hline", "geom_line", "geom_ribbon", "geom_vline",
Expand All @@ -12,6 +13,8 @@ importFrom("ggplot2", "geom_boxplot", "geom_density", "geom_tile",
"guide_legend", "margin", "guides","xlab","ylab", "unit",
"element_rect", "geom_jitter", "scale_shape_manual", "geom_bar",
"scale_fill_gradient", "sec_axis", "facet_wrap")
importFrom("ggplot2", "geom_segment", "geom_polygon", "geom_text")
importFrom("grDevices", "chull")
importFrom("gridExtra", "grid.arrange", "arrangeGrob")
importFrom("grid", "textGrob", "gpar")
importFrom("dplyr", "coalesce", "summarise", "group_by_all", "n")
Expand Down
149 changes: 149 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
# panelView 1.3.1

## Visual refresh

* Plot defaults updated for a cleaner, publication-ready look across all four
plot types: plain left-aligned titles, base font size 11, white background
for status heatmaps, subtle major-x gridlines for trajectories, and a thin
gray dashed treatment-onset marker (replaces the prior thick white line).
* Multi-level discrete treatment palette refreshed to a muted, perceptually
distinct sequence; binary and continuous palettes unchanged.
* Control-trajectory gray lightened to `grey75` so dense overlaps no longer
darken into a near-black band.

## New arguments

* `theme = c("default", "red")`: optional theme switch. `"red"` activates a
high-contrast publication recipe with gray control / brick-red treated-post
for status and outcome plots and a solid black dashed treatment-onset line.
* `group.mean.overlay = FALSE`: opt-in for the outcome plot. Dims per-unit
trajectories and overlays a heavy group-mean line plus a 10--90% quantile
ribbon per group. Currently scoped to the main DID continuous-outcome path.

## Deprecations

* `theme.bw = FALSE` is soft-deprecated and emits a one-time warning. The
legacy gray-panel look is no longer demonstrated in the tutorial and may
be removed in a future major release.

# panelView 1.3.0

## New features

* Add `type = "network"` to visualize the connectivity structure of multi-way
fixed effects as a k-partite graph (Correia 2016). The new plot identifies
singletons, connected components, and non-unique (duplicate) observations via
weighted edges, and supports two or more fixed-effect dimensions as well as
formula-based missingness.
* New parameters for the network plot: `show.singletons`,
`highlight.components`, `layout`, `node.size`, `show.labels`, `edge.color`,
`edge.alpha`, `edge.width`, and `singleton.color`.
* Add `igraph` to `Suggests` (used only by `type = "network"`).
* Add a new tutorial chapter (chapter 4) documenting the network
visualization, and expand the Quarto tutorial index and references.

## Improvements

* Update tutorial chapter 1 and use consistent `U`-prefix naming for simulated
units in chapter 4.
* Update `DESCRIPTION` to describe the new k-partite graph functionality.

# panelView 1.2.1

## Bug fixes

* Remove spurious runtime warnings: fix deprecated `group_by_all()` by
switching to `group_by(across(everything()))`; drop unused
`position = "identity"` and `stat = "identity"` in ggplot2 layers.
* Fix a `margin()` vector-argument warning and a false-positive `by.cohort`
warning.
* Address ggplot2 `size` deprecation and tighten `class()` comparisons.
* Fix a bivariate plot title bug.

## Internal

* Refactor monolithic `panelView.R` into focused plot files (one file per plot
type).
* Add a testthat suite (36 tests).
* Replace the legacy vignette with a Quarto-based manual and add a changelog
chapter.
* Add `ARCHITECTURE.md` with Mermaid diagrams documenting the package
structure.
* `R CMD check --as-cran`: 0 errors, 0 warnings, 0 notes.

# panelView 1.1.17

Add links to the [JSS paper](https://doi.org/10.18637/jss.v107.i07).

# panelView 1.1.16

* Add `collapse.history` to allow users to collapse units by treatment history
in a `treat` plot.
* Add `show.missing` to output missing-data summary statistics for the key
variables.
* Add `axis.lab.angle` to allow users to change the angle of the x-axis
labels.
* Allow `pre.post` to be applied to an `outcome` plot.
* Change the color scheme in the `outcome` plot.
* Miscellaneous bug fixes.

# panelView 1.1.11

* Add `by.cohort` to plot average outcome trajectories of units sharing the
same treatment history (when the number of unique histories is under 20).

# panelView 1.1.10

* Add `by.group.side` to arrange subfigures of `by.group = TRUE` in a row
rather than a column.
* Add `display.all` to show all units when the number of units exceeds 500
(otherwise a random sample of 500 units is shown).

# panelView 1.1.8

* Add `leave.gap` to keep gaps in time using white bars when the time variable
is unevenly spaced (e.g., due to missing data).
* Add `type = "missing"` to plot missingness in data.

# panelView 1.1.7

* Rename the main function from `panelView` to `panelview` for consistency
with the Stata version.
* In outcome plots, use a dot to represent the last-period observation of a
unit that is treated in the last period.

# panelView 1.1.6

* Plot time series of outcome and treatment in one graph
(`type = "bivar"`). By default, plots mean D and Y against time in the same
graph; use `by.unit = TRUE` to plot each unit. New `style`, `ylim`, and
`lwd` options control line/bar styles, axis limits, and line width.

# panelView 1.1.4

* Add `treat.type` to control whether the treatment variable is treated as
continuous (`"continuous"`) or discrete (`"discrete"`).

# panelView 1.1.2

* Rename plot `type`s: `"treat"` (formerly `"missing"`) for treatment status
and `"outcome"` (formerly `"raw"`) for raw outcomes.
* Allow more than two treatment levels.
* Add `pre.post` to distinguish pre- and post-treatment observations for
treated units in a DID setting.
* Rename `by.treatment` to `by.timing` and `treatment` to `ignore.treat`.
* Add fontsize options.

# panelView 1.0.5

Fix typos. CRAN release.

# panelView 1.0.4

* Allow plotting treated units on top of control units in the "missing" plot.
* Streamline the `color` option for both the "missing" and "raw" plots.

# panelView 1.0.3

* Allow changing the color of bricks in the "missing" plot.
* Allow leaving the treatment blank in both the "missing" and "raw" plots.
Loading
Loading