Learn R Programming

PanelMatch (version 3.0.0)

plot.PanelData: Create basic plots of PanelData objects

Description

Create basic plots of PanelData objects

Usage

# S3 method for PanelData
plot(x, ..., plotting.variable = NA)

Value

Returns a ggplot2 object created by geom_tile(). The basic figure shows units along the y-axis and time along the x-axis. The figure takes the form of a heatmap. The value of the plotting.variable argument is used to fill in the color of the cells.

Arguments

x

PanelData object

...

Not used

plotting.variable

character string specifying which variable to plot in the resulting figure. The values of this variable will be used to fill in cells on the resulting heatmap. Defaults to whatever is specified as the treatment variable.

Examples

Run this code
dem$rdata <- rnorm(nrow(dem))
d <- PanelData(dem, "wbcode2", "year", "dem", "y")
plot(d)
plot(d, plotting.variable = "rdata")

Run the code above in your browser using DataLab