Learn R Programming

MaddisonData (version 1.0.2)

MaddisonLeaders: Plot selected countries

Description

MaddisonLeaders computes the countries with the highest gdppc for each year.

Usage

MaddisonLeaders(
  except = character(0),
  y = "gdppc",
  group = "ISO",
  data = MaddisonData::MaddisonData,
  x = "year"
)

Value

an data.frame with columns

  • paste0(x, 'Begin),

  • paste0(x, 'End'),

  • paste0(y, '0'),

  • paste0(y, '1'), and

  • {{group}}

(defaults:

  • yearBegin,

  • yearEnd,

  • gdppc0,

  • gdppc1, and

  • ISO, plus

  • dy0 = paste0(x, 'End') - paste0(x, 'Begin') and

  • dy1 = c(tail(paste0(x, 'Begin'), -1) - head(paste0(x, 'End'), -1), NA) (defaults: dy0 = yearEnd- yearBegin and dy1 = c(tail(yearBegin, -1) - head(yearEnd, -1), NA) )

with an attribute LeaderByYear = a data.frame with columns, {{x}}, paste0('max', y), and {{group}} (defaults: year, maxgdppc, ISO).

Arguments

except

either NULL to select all the data in MaddisonData or a character vector of group codes to EXCLUDE, e.g., so the result reflects apparent technology leaders, excluding countries whose high gdppc may be due to a dominant position in a single commodity.

y

name of column in data to consider. Default = gdppc.

group

name of column in data as the grouping variable. Default = ISO.

data

data.frame or tibble::tibble with first two columns being ISO and year and y being the name of another column.

x

time variable. Default = year.

Examples

Run this code
Leaders0 <- MaddisonLeaders() # max GDPpc for each year. 

# Presumed technology leaders without commodity leaders with narrow 
# economies 
Leaders1 <- MaddisonLeaders(c('ARE', 'KWT', 'QAT')) 
# since 1600 
MadDat1600 <- subset(MaddisonData, year>1600)
Leaders1600 <- MaddisonLeaders(c('ARE', 'KWT', 'QAT'), data=MadDat1600)

Run the code above in your browser using DataLab