knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
Authors: Hongyu Mou (UCLA); Licheng Liu (MIT); Yiqing Xu (Stanford)
Date: Sep 24, 2023
Repos: Github (1.1.17) CRAN (1.1.17)
Examples: R code used in the tutorial can be downloaded from here.
panelView visualizes panel data. It has three main functionalities:
You can install the up-to-date development version from GitHub:
# if not already installed install.packages('devtools', repos = 'http://cran.us.r-project.org') # note: "V" is capitalized devtools::install_github('xuyiqing/panelView')
You can also install the panelView package from CRAN:
install.packages('panelView')
If you encounter an installation/execution error, please remove the old package and reinstall panelView.
remove.packages('panelView') # or remove.packages('panelview') # package name "panelview" no longer in use
For example, plot treatment status in a panel dataset:
library(panelView) data(panelView) panelview(turnout ~ policy_edr + policy_mail_in + policy_motor, data = turnout, index = c("abb","year"), xlab = "Year", ylab = "State")
Note that "V" in the package name is capitalized while "v" in the function name is not---to be consistent with the Stata version.
See the tutorial page for more details.
For a paper version of the tutorial, see Mou, Liu & Xu (2023): "Panel Data Visualization in R (panelView) and Stata (panelview)."
Please report bugs to yiqingxu [at] stanford.edu with your sample code and data file. Much appreciated!
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.