Learn R Programming

countries (version 1.2.0)

check_wide_format: Check for wide country data formats

Description

The function looks for country names or year information in the column names. This function is designed for simple panel country data, in which countries' time series are arranged side by side on columns or stacked on rows. The function will only return year/country column names if at least 3 country/year column names are detected.

Usage

check_wide_format(x, adjacency = TRUE)

Value

Returns a data.frame identifying the columns names that contain country or year information.

Arguments

x

A dataframe

adjacency

Logical value indicating whether column names containing country or year information need to be adjacent to each other. Default is TRUE

See Also

find_keycol, find_countrycol, find_timecol

Examples

Run this code
example <- data.frame(Year=2000:2010, China=0:10, US=10:20, Vietnam=30:40)
check_wide_format(x=example)

Run the code above in your browser using DataLab