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

> ### Name: build.panel
> ### Title: build.panel: Build PSID panel data set
> ### Aliases: build.panel
> 
> ### ** Examples
> 
> ## Not run: 
> ##D # ################################################
> ##D # Real-world example: not run because takes long.
> ##D # Build panel with income, wage, age and education
> ##D # ################################################
> ##D 
> ##D # The package is installed with a list of variables
> ##D # Alternatively, search for names with \code{getNamesPSID}
> ##D r = system.file(package="psidR")
> ##D f = fread(file.path(r,"psid-lists","famvars.txt"))
> ##D i = fread(file.path(r,"psid-lists","indvars.txt"))
> ##D 
> ##D f[1:38,vgroup := "wage"]
> ##D f[39:76,vgroup := "earnings"]
> ##D setkey(f,vgroup)
> ##D 
> ##D i[1:38, vgroup := "age"]
> ##D i[39:76, vgroup := "educ"]  # caution about 2 first years: no educ data
> ##D i[77:114, vgroup := "weight"]
> ##D setkey(i,vgroup)
> ##D 
> ##D ind = cbind(i[J("age"),list(year,age=variable)],
> ##D 			   i[J("educ"),list(educ=variable)],
> ##D 			   i[J("weight"),list(weight=variable)])
> ##D fam = cbind(f[J("wage"),list(year,wage=variable)],
> ##D 			   f[J("earnings"),list(earnings=variable)])
> ##D 
> ##D # caution: this step will take many hours
> ##D d = build.panel(datadir="~/data",
> ##D                 fam.vars=fam,
> ##D 				   ind.vars=ind,
> ##D                 SAScii = TRUE, 
> ##D                 heads.only = TRUE,
> ##D                 sample="SRC",
> ##D                 design=2)
> ## End(Not run) 
> 
> # ######################################
> # reproducible example on artifical data. 
> # run this with example(build.panel).
> # ######################################
> 
> ## make reproducible family data sets for 2 years
> ## variables are: family income (Money) and age
> 
> ## Data acquisition step: you download data or
> ## run build.panel with sascii=TRUE
> 
> # testPSID creates artifical PSID data
> td <- testPSID(N=12,N.attr=0)
> fam1985 <- data.table::copy(td$famvars1985)
> fam1986 <- data.table::copy(td$famvars1986)
> IND2009ER <- data.table::copy(td$IND2009ER)
> 
> # create a temporary datadir
> my.dir <- tempdir()
> #save those in the datadir
> # notice different R formats admissible
> save(fam1985,file=paste0(my.dir,"/FAM1985ER.rda"))
> save(fam1986,file=paste0(my.dir,"/FAM1986ER.RData"))
> save(IND2009ER,file=paste0(my.dir,"/IND2009ER.RData"))
> 
> ## end Data acquisition step.
> 
> # now define which famvars
> famvars <- data.frame(year=c(1985,1986),
+                       money=c("Money85","Money86"),
+                       age=c("age85","age86"))
> 
> # create ind.vars
> indvars <- data.frame(year=c(1985,1986),ind.weight=c("ER30497","ER30534"))
> 
> # call the builder
> # data will contain column "relation.head" holding the relationship code.
> 
> d <- build.panel(datadir=my.dir,fam.vars=famvars,
+                  ind.vars=indvars,
+                  heads.only=FALSE,verbose=TRUE)	
psidR: Loading Family data
psidR: loaded individual file: /tmp/RtmpdkvEf0/IND2009ER.RData 
psidR: total memory load in MB:
[1] 1
psidR: here is the list of hardcoded PSID variables
psidR: The merge is based on equal values in ind.interview and fam.interview
    year ind.interview ind.seq ind.head ind.head.num fam.interview stratum
 1: 1968       ER30001    <NA>  ER30003            1            V3 ER31996
 2: 1969       ER30020 ER30021  ER30022            1          V442 ER31996
 3: 1970       ER30043 ER30044  ER30045            1         V1102 ER31996
 4: 1971       ER30067 ER30068  ER30069            1         V1802 ER31996
 5: 1972       ER30091 ER30092  ER30093            1         V2402 ER31996
 6: 1973       ER30117 ER30118  ER30119            1         V3002 ER31996
 7: 1974       ER30138 ER30139  ER30140            1         V3402 ER31996
 8: 1975       ER30160 ER30161  ER30162            1         V3802 ER31996
 9: 1976       ER30188 ER30189  ER30190            1         V4302 ER31996
10: 1977       ER30217 ER30218  ER30219            1         V5202 ER31996
11: 1978       ER30246 ER30247  ER30248            1         V5702 ER31996
12: 1979       ER30283 ER30284  ER30285            1         V6302 ER31996
13: 1980       ER30313 ER30314  ER30315            1         V6902 ER31996
14: 1981       ER30343 ER30344  ER30345            1         V7502 ER31996
15: 1982       ER30373 ER30374  ER30375            1         V8202 ER31996
16: 1983       ER30399 ER30400  ER30401           10         V8802 ER31996
17: 1984       ER30429 ER30430  ER30431           10        V10002 ER31996
18: 1985       ER30463 ER30464  ER30465           10        V11102 ER31996
19: 1986       ER30498 ER30499  ER30500           10        V12502 ER31996
20: 1987       ER30535 ER30536  ER30537           10        V13702 ER31996
21: 1988       ER30570 ER30571  ER30572           10        V14802 ER31996
22: 1989       ER30606 ER30607  ER30608           10        V16302 ER31996
23: 1990       ER30642 ER30643  ER30644           10        V17702 ER31996
24: 1991       ER30689 ER30690  ER30691           10        V19002 ER31996
25: 1992       ER30733 ER30734  ER30735           10        V20302 ER31996
26: 1993       ER30806 ER30807  ER30808           10        V21602 ER31996
27: 1994       ER33101 ER33102  ER33103           10        ER2002 ER31996
28: 1995       ER33201 ER33202  ER33203           10        ER5002 ER31996
29: 1996       ER33301 ER33302  ER33303           10        ER7002 ER31996
30: 1997       ER33401 ER33402  ER33403           10       ER10002 ER31996
31: 1999       ER33501 ER33502  ER33503           10       ER13002 ER31996
32: 2001       ER33601 ER33602  ER33603           10       ER17002 ER31996
33: 2003       ER33701 ER33702  ER33703           10       ER21002 ER31996
34: 2005       ER33801 ER33802  ER33803           10       ER25002 ER31996
35: 2007       ER33901 ER33902  ER33903           10       ER36002 ER31996
36: 2009       ER34001 ER34002  ER34003           10       ER42002 ER31996
37: 2011       ER34101 ER34102  ER34103           10       ER47302 ER31996
38: 2013       ER34201 ER34202  ER34203           10       ER53002 ER31996
39: 2015       ER34301 ER34302  ER34303           10       ER60002 ER31996
    year ind.interview ind.seq ind.head ind.head.num fam.interview stratum
=============================================
psidR: currently working on data for year 1985 
loaded family file: /tmp/RtmpdkvEf0/FAM1985ER.rda 
current memory load in MB:
0 Mb
=============================================
psidR: currently working on data for year 1986 
loaded family file: /tmp/RtmpdkvEf0/FAM1986ER.RData 
current memory load in MB:
0 Mb
Error in `[.data.table`(data2, , `:=`(present, length(year)), by = pid) : 
  SETLENGTH() cannot be applied to an ALTVEC object.
Calls: build.panel -> [ -> [.data.table
Execution halted