Changelog
v1.3.3
(2026-05-19)
- New
sample =overlay onpanelview(type = "treat"): shades out-of-sample cells in faded “Not used” colors. Accepts a logical T x N matrix, afect/gsynth/tjbalfit (auto-pulls$sample), or aPanelMatchobject (via newpanelmatch_to_sample(pm, pd)helper). - New
panelview(fit)entry-point: reconstructsdata,formula,index, and$samplefrom a fit’s slots;sample.sort = TRUEputs in-sample units on top. -
coloraccepts a named vector with slotscontrol,treated,treated.pre,missing,unused.control,unused.treated. Default collapsesunused.controlandunused.treatedto a single grey “Not used” tier; assign distinct values to opt into the per-status split.
v1.3.2
(2026-05-14)
- Outcome plots: treated overlay no longer spans control intervals within a reversal unit (each treated spell renders as its own segment).
- Outcome plots under
leave.gap = FALSE: gaps from dropped rows are now drawn as a dotted bridge instead of a solid interpolated line. - New tutorial section “Treatment reversal and missing data” with worked examples on
fect::sim_base.
v1.3.1
(2026-05-13)
- Plot defaults refreshed for a cleaner, publication-ready look: plain left-aligned titles at base 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 separator).
- Outcome-plot draw order fixed: control trajectories are now drawn first, treated-pre next, treated-post on top, so treated lines are no longer covered by the control band.
- New argument
theme = c("default", "red"). The optional"red"theme switches the binary status palette to gray control / dark-gray treated-pre / brick-red treated-post, and the outcome onset marker to a solid black dashed line. The"default"palette also moves to a blue progression (gray control, medium blue treated-pre, dark navy treated-post) so red is reserved fortheme = "red". - New argument
group.mean.overlay = FALSE. WhenTRUE, the outcome plot dims per-unit trajectories and overlays a heavy group-mean line plus a 10–90% quantile ribbon per treatment-status group. Currently scoped to the main DID continuous-outcome path. -
theme.bw = FALSEis soft-deprecated. The legacy gray-panel look still works but emits a one-time warning; the tutorial no longer demonstrates it. - CRAN release (2026-05-13).
v1.3.0
(2026-03-21)
- Added
type = "network"for visualizing the connectivity structure of panel data as a \(k\)-partite graph, following the graph-theoretic framework of Correia (2016). Features:- Supports 2 or more sets of fixed effects (e.g., unit \(\times\) time, worker \(\times\) firm \(\times\) year)
- Identifies and highlights singletons (degree-1 nodes)
- Detects connected components with convex hull shading
- Handles non-unique observations via weighted (thicker) edges
- Three layout algorithms: Fruchterman–Reingold (
"fr"), bipartite, circle - Formula support:
Y ~ D + Xdrops rows with missing values before building the graph - Programmatic return:
$singletons,$multi_edges,$n_components,$graph,$plot
- New parameters:
show.singletons,highlight.components,layout,node.size,show.labels,edge.color,edge.alpha,edge.width,singleton.color - Added igraph to
Suggests(conditional dependency fortype = "network") - Added tutorial chapter: Network Structure
- Backward-compatible aliases:
type = "graph"andtype = "singleton"both map to"network"
v1.2.1
(2026-03-20)
- Fixed runtime warnings: deprecated
group_by_all(), spuriousposition = "identity"inggplot(),margin()vector argument, false-positiveby.cohortwarning.
v1.2.0
(2026-03-17)
- Refactored monolithic
panelView.R(3700+ lines) into three focused files:plot-treat.R,plot-outcome.R,plot-bivariate.R. - Fixed ggplot2
size→linewidthdeprecation ingeom_hline/geom_vline. - Replaced
class() ==checks withinherits(). - Fixed bivariate plot title bug.
- Added test suite (
tests/testthat/test-panelview.R). - Replaced single-file vignette with Quarto book tutorial.
v1.1.18
- Fix bugs with
collapse.history. - Set
shade.post = FALSEby default.
v1.1.17
Add links to the JSS paper.
v1.1.16
- Add
collapse.historyto allow users to collapse unit by treatment history in atreatplot. - Add
show.missingto output missing data summary statistics for the key variables. - Add
axis.lab.angleto allow users to change the angle of the axis labels on the x-axis. - Allow
pre.postto be applied to anoutcomeplot. - Change the color scheme in the
outcomeplot. - Fix bugs.
v1.1.11
- Add
by.cohortto allow users to plot the average outcome trajectories of units with the same treatment history (if the number of unique treatment history is less than 20).
v1.1.10
- Add
by.group.sideto arrange subfigures ofby.group = TRUEin a row rather than in a column. - Add
display.allto show all units if the number of units is more than 500; otherwise we randomly select 500 units to present.
v1.1.8
- Add a new option
leave.gapto keep gaps in time using white bars when the time variable is not evenly distributed (possibly due to missing data). - Add
type = "missing"to plot the missingness in data.
v1.1.7
- Replace the function name panelView with panelview to be consistent with the Stata version.
- In the outcome plot, use a dot to represent the last-period observation of a unit that gets treated in the last period.
v1.1.6
Plot time series of outcome and treatment in one graph (type = "bivar"). Options: by.unit = TRUE for per-unit plots, style for line/bar styles, ylim for axis limits, lwd for line width.
v1.1.4
Add treat.type to control whether the treatment variable is treated as continuous or discrete.
v1.1.2
- Change plot
type:"treat"(was"missing") for treatment status;"outcome"(was"raw") for outcomes. - Allow >2 treatment levels.
- Add
pre.postto distinguish pre- and post-treatment observations. - Replace
by.treatmentwithby.timingandtreatmentwithignore.treat. - Add fontsize options.
v1.0.5
Fix typos. CRAN release.
v1.0.4
- Allow users to plot treated units on top of control units.
- Streamline the
coloroption for both plot types.
v1.0.3
- Allow users to change the color of bricks in the treatment plot.
- Allow users to leave the treatment blank in both plot types.