Learn R Programming

valueprhr (version 0.1.0)

validate_panel_data: Validate Panel Data Structure

Description

Checks that panel data has required columns and valid structure.

Usage

validate_panel_data(panel_data, require_log = TRUE)

Value

TRUE invisibly if valid, otherwise stops with informative error.

Arguments

panel_data

Data frame to validate.

require_log

Logical. Check for log-transformed columns. Default TRUE.

Examples

Run this code
set.seed(123)
panel <- data.frame(
  year = rep(2000:2002, 3),
  sector = rep(c("A", "B", "C"), each = 3),
  log_direct = rnorm(9),
  log_production = rnorm(9)
)
validate_panel_data(panel)

Run the code above in your browser using DataLab