psidR icon indicating copy to clipboard operation
psidR copied to clipboard

build.panel error

Open wooyongp opened this issue 1 year ago • 1 comments

r = system.file(package="psidR") f = fread(file.path(r,"psid-lists","famvars.txt")) i = fread(file.path(r,"psid-lists","indvars.txt"))

i = dcast(i[,list(year,name,variable)],year~name, value.var = "variable") f = dcast(f[,list(year,name,variable)],year~name, value.var = "variable")

d = build.panel(datadir='data',fam.vars=f,ind.vars=i, heads.only = FALSE,design="all")

After entering the code above, I got this error message for the final line...

Error in load(file = fam.dat[iy], envir = tmp.env) : bad restore file magic number (file may be corrupted) -- no data loaded In addition: There were 41 warnings (use warnings() to see them)

wooyongp avatar Feb 15 '24 02:02 wooyongp

The difference that I've made from the code presented in your example is that I downloaded the data into directory using relative path, would that cause this problem?

wooyongp avatar Feb 15 '24 02:02 wooyongp