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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: SurveyDate
> ### Title: Dataset containing survey details for each subject, for each
> ###   year
> ### Aliases: SurveyDate
> ### Keywords: datasets
> 
> ### ** Examples
> 
> library(NlsyLinks) #Load the package into the current R session.
> 
> summary(SurveyDate)
   SubjectTag           SurveySource      SurveyYear     SurveyDate        
 Min.   :    100   NoInterview:257047   Min.   :1979   Min.   :1979-01-03  
 1st Qu.: 313900   Gen1       :236338   1st Qu.:1985   1st Qu.:1985-03-15  
 Median : 619752   Gen2C      : 52038   Median :1990   Median :1991-09-23  
 Mean   : 618530   Gen2YA     : 35329   Mean   :1992   Mean   :1993-02-13  
 3rd Qu.: 914403                        3rd Qu.:1998   3rd Qu.:2000-08-12  
 Max.   :1268600                        Max.   :2010   Max.   :2011-01-19  
                                                       NA's   :257048      
 AgeSelfReportYears AgeCalculateYears      Age        
 Min.   : 0.12      Min.   : 0.00     Min.   : 0.00   
 1st Qu.:18.50      1st Qu.:18.48     1st Qu.:18.48   
 Median :24.50      Median :24.73     Median :24.73   
 Mean   :25.34      Mean   :25.31     Mean   :25.31   
 3rd Qu.:32.50      3rd Qu.:32.31     3rd Qu.:32.31   
 Max.   :53.50      Max.   :54.92     Max.   :54.92   
 NA's   :257233     NA's   :257048    NA's   :257047  
> table(SurveyDate$SurveyYear, SurveyDate$SurveySource)
      
       NoInterview  Gen1 Gen2C Gen2YA
  1979       11512 12686     0      0
  1980       12057 12141     0      0
  1981       12003 12195     0      0
  1982       12075 12123     0      0
  1983       11977 12221     0      0
  1984       12129 12069     0      0
  1985       13304 10894     0      0
  1986        8581 10655  4962      0
  1987       13713 10485     0      0
  1988        8064 10465  5669      0
  1989       13593 10605     0      0
  1990        7971 10436  5791      0
  1991       15180  9018     0      0
  1992        8674  9016  6508      0
  1993       15187  9011     0      0
  1994        8287  8889  6042    980
  1996        8494  8636  5396   1672
  1998        8764  8399  4896   2139
  2000        9755  8033  3385   3025
  2002        9047  7724  3189   4238
  2004        9058  7661  2455   5024
  2006        8944  7654  1756   5844
  2008        8936  7757  1200   6305
  2010        9742  7565   789   6102
> table(is.na(SurveyDate$AgeSelfReportYears), is.na(SurveyDate$AgeCalculateYears))
       
         FALSE   TRUE
  FALSE 323518      1
  TRUE     186 257047
> 
> if( require(ggplot2) & require(plyr) ) {
+   dsSourceYear <- plyr::count(SurveyDate, c("SurveyYear", "SurveySource"))
+   dsSourceYear <- dsSourceYear[dsSourceYear$SurveySource != "NoInterview", ]
+   
+   ggplot(dsSourceYear, aes(x=SurveyYear, y=freq, color=SurveySource)) +
+     geom_line(size=2) +
+     geom_point(size=5, shape=21) +
+     scale_color_brewer(palette = "Dark2") +
+     theme_bw() +
+     theme(legend.position=c(0,0), legend.justification=c(0,0))
+     
+   ggplot(SurveyDate, aes(x=AgeSelfReportYears, y=AgeCalculateYears)) +
+     geom_abline() +
+     geom_point(shape=21) +
+     theme_bw() 
+ } 
Loading required package: ggplot2
Loading required package: plyr
Warning: Removed 257234 rows containing missing values (geom_point).
Error in grid.Call.graphics(C_setviewport, vp, TRUE) : 
  VECTOR_ELT() can only be applied to a 'list', not a 'double'
Calls: <Anonymous> ... lapply -> FUN -> push.vp.viewport -> grid.Call.graphics
Execution halted