Running examples in ‘Ecdat-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: incomeInequality
> ### Title: Income Inequality in the US
> ### Aliases: incomeInequality
> ### Keywords: datasets
> 
> ### ** Examples
> 
> ##
> ## Rato of IRS to census estimates for the 95th percentile
> ##
> data(incomeInequality)
> plot(P95IRSvsCensus~Year, incomeInequality, type='b')
> # starts ~0.74, trends rapidly up to ~0.97,
> # then drifts back to ~0.75
> abline(h=0.75)
> abline(v=1989)
> # check
> sum(is.na(incomeInequality$P95IRSvsCensus))
[1] 0
> # The Census data runs to 2011;  Pikety and Saez runs to 2010.
> quantile(incomeInequality$P95IRSvsCensus, na.rm=TRUE)
       0%       25%       50%       75%      100% 
0.7319601 0.7637343 0.8178705 0.8905550 0.9892483 
> # 0.72 ... 0.98
> 
> ##
> ## Persons per Family
> ##
> 
> plot(personsPerFamily~Year, incomeInequality, type='b')
> quantile(incomeInequality$personsPerFamily)
      0%      25%      50%      75%     100% 
3.722238 3.798983 3.844766 3.890913 4.006411 
> # ranges from 3.72 to 4.01 with median 3.84
> #  -- almost 4
> 
> ##
> ## GDP per family
> ##
> plot(realGDPperFamily~Year, incomeInequality, type='b', log='y')
> 
> ##
> ## Plot the mean then the first quintile, then the median,
> ##            99th, 99.9th and 99.99th percentiles
> ##
> plotCols <- c(21, 3, 5, 11, 13:14)
> kcols <- length(plotCols)
> plotColors <- c(1:6, 8:13)[1:kcols] # omit 7=yellow
> plotLty <- 1:kcols
> 
> matplot(incomeInequality$Year, incomeInequality[plotCols]/1000,
+         log='y', type='l', col=plotColors, lty=plotLty)
> 
> #*** Growth broadly shared 1947 - 1970, then began diverging
> #*** The divergence has been most pronounced among the top 1%
> #*** and especially the top 0.01%
> 
> ##
> ## Growth rate by quantile 1947-1970 and 1970 - present
> ##
> keyYears <- c(1947, 1970, 2010)
> (iYears <- which(is.element(incomeInequality$Year, keyYears)))
[1]  1 24 64
> 
> (dYears <- diff(keyYears))
[1] 23 40
> kk <- length(keyYears)
> (lblYrs <- paste(keyYears[-kk], keyYears[-1], sep='-'))
[1] "1947-1970" "1970-2010"
> 
> (growth <- sapply(incomeInequality[iYears,], function(x, labels=lblYrs){
+     dxi <- exp(diff(log(x)))
+     names(dxi) <- labels
+     dxi
+ } ))
              Year Number.thousands quintile1 quintile2   median quintile3
1947-1970 1.011813         1.402557  1.889560  1.910242 1.911692  1.913143
1970-2010 1.020305         1.523331  1.037714  1.151304 1.226677  1.306985
          quintile4      p95      P90      P95      P99    P99.5    P99.9
1947-1970  1.853266 1.763044 2.132507 2.070092 1.597485 1.474057 1.305936
1970-2010  1.457630 1.647526 1.284014 1.410992 1.699962 1.822060 2.494717
            P99.99 realGDP.M GDP.Deflator PopulationK realGDPperCap
1947-1970 1.333545  2.434816     1.770543    1.422984      1.711064
1970-2010 3.914579  3.132755     4.431699    1.510447      2.074059
          P95IRSvsCensus personsPerFamily realGDPperFamily mean.median
1947-1970      1.1741578        1.0145644         1.735984    0.908088
1970-2010      0.8564303        0.9915421         2.056517    1.676494
> 
> # as percent
> (gr <- round(100*(growth-1), 1))
          Year Number.thousands quintile1 quintile2 median quintile3 quintile4
1947-1970  1.2             40.3      89.0      91.0   91.2      91.3      85.3
1970-2010  2.0             52.3       3.8      15.1   22.7      30.7      45.8
           p95   P90   P95  P99 P99.5 P99.9 P99.99 realGDP.M GDP.Deflator
1947-1970 76.3 113.3 107.0 59.7  47.4  30.6   33.4     143.5         77.1
1970-2010 64.8  28.4  41.1 70.0  82.2 149.5  291.5     213.3        343.2
          PopulationK realGDPperCap P95IRSvsCensus personsPerFamily
1947-1970        42.3          71.1           17.4              1.5
1970-2010        51.0         107.4          -14.4             -0.8
          realGDPperFamily mean.median
1947-1970             73.6        -9.2
1970-2010            105.7        67.6
> 
> # The average annual income (realGDPperFamily) doubled between
> # 1970 and 2010 (increased by 101 percent), while the median household
> # income increased only 23 percent.
> 
> ##
> ## Income lost by each quantile 1970-2010
> ## relative to the broadly shared growth 1947-1970
> ##
> (lostGrowth <- (growth[, 'realGDPperFamily']-growth[, plotCols]))
          realGDPperFamily  quintile1     median       P99      P99.9
1947-1970                0 -0.1535755 -0.1757074 0.1384989  0.4300485
1970-2010                0  1.0188031  0.8298398 0.3565554 -0.4381997
              P99.99
1947-1970  0.4024393
1970-2010 -1.8580616
> # 1947-1970:  The median gained 20% relative to the mean,
> #           while the top 1% lost ground
> # 1970-2010:  The median lost 79%, the 99th percentile lost 29%,
> #           while the top 0.1% gained
> 
> (lostIncome <- (lostGrowth[2, ] *
+                 incomeInequality[iYears[2], plotCols]))
   realGDPperFamily quintile1   median      P99     P99.9   P99.99
58                0  27419.05 42458.58 76561.71 -274125.4 -3926103
> # The median family lost $39,000 per year in income
> # relative to what they would have with the same economic growth
> # broadly shared as during 1947-1970.
> # That's slightly over $36,500 per year = $100 per day
> 
> (grYr <- growth^(1/dYears))
              Year Number.thousands quintile1 quintile2   median quintile3
1947-1970 1.000511         1.014817  1.028053  1.028540 1.028574  1.028608
1970-2010 1.000503         1.010578  1.000926  1.003529 1.005121  1.006716
          quintile4     p95      P90      P95      P99    P99.5    P99.9
1947-1970  1.027187 1.02496 1.033474 1.032140 1.020575 1.017013 1.011673
1970-2010  1.009465 1.01256 1.006269 1.008644 1.013354 1.015112 1.023118
            P99.99 realGDP.M GDP.Deflator PopulationK realGDPperCap
1947-1970 1.012593  1.039448     1.025150    1.015455      1.023628
1970-2010 1.034706  1.028959     1.037921    1.010363      1.018405
          P95IRSvsCensus personsPerFamily realGDPperFamily mean.median
1947-1970      1.0070049        1.0006289         1.024271   0.9958169
1970-2010      0.9961329        0.9997877         1.018189   1.0130014
> (grYr. <- round(100*(grYr-1), 1))
          Year Number.thousands quintile1 quintile2 median quintile3 quintile4
1947-1970  0.1              1.5       2.8       2.9    2.9       2.9       2.7
1970-2010  0.1              1.1       0.1       0.4    0.5       0.7       0.9
          p95 P90 P95 P99 P99.5 P99.9 P99.99 realGDP.M GDP.Deflator PopulationK
1947-1970 2.5 3.3 3.2 2.1   1.7   1.2    1.3       3.9          2.5         1.5
1970-2010 1.3 0.6 0.9 1.3   1.5   2.3    3.5       2.9          3.8         1.0
          realGDPperCap P95IRSvsCensus personsPerFamily realGDPperFamily
1947-1970           2.4            0.7              0.1              2.4
1970-2010           1.8           -0.4              0.0              1.8
          mean.median
1947-1970        -0.4
1970-2010         1.3
> 
> ##
> ## Regression line:  linear spline
> ##
> 
> (varyg <- c(3:14, 21))
 [1]  3  4  5  6  7  8  9 10 11 12 13 14 21
> Varyg <- names(incomeInequality)[varyg]
> str(F01ps <- reshape(incomeInequality[c(1, varyg)], idvar='Year',
+                      ids=F1.PikettySeaz$Year,
+                      times=Varyg, timevar='pctile',
+                      varying=list(Varyg), direction='long'))
Error in reshapeLong(data, idvar = idvar, timevar = timevar, varying = varying,  : 
  object 'F1.PikettySeaz' not found
Calls: str -> reshape -> reshapeLong
Execution halted