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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: build.panel
> ### Title: build.panel: Build PSID panel data set
> ### Aliases: build.panel
> 
> ### ** Examples
> 
> 
> # ######################################
> # 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:
> ## 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)
> IND2019ER <- data.table::copy(td$IND2019ER)
> 
> # 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(IND2019ER,file=paste0(my.dir,"/IND2019ER.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)	
INFO [2025-12-21 17:59:38] found FAM1985ER.rda already downloaded
INFO [2025-12-21 17:59:38] found FAM1986ER.rda already downloaded
INFO [2025-12-21 17:59:38] Will download missing datasets now
INFO [2025-12-21 17:59:38] will download latest individual index: IND2021ER
This can take several hours/days to download.
 want to go ahead? give me 'yes' or 'no'.
INFO [2025-12-21 17:59:38] psidR: Loading Family data from .rda files
INFO [2025-12-21 17:59:38] psidR: loaded individual file: /tmp/RtmphsDxOx/IND2019ER.RData
INFO [2025-12-21 17:59:38] psidR: total memory load in MB: 1
INFO [2025-12-21 17:59:38] psidR: currently working on data for year 1985
INFO [2025-12-21 17:59:38] psidR: currently working on data for year 1986
Error in `[.data.table`(data2, , `:=`(present, length(year)), by = pid) : 
  attempt access index 10/10 in VECTOR_ELT
Calls: build.panel -> [ -> [.data.table
Execution halted