powered by
The function accepts a (file path to) CSV file and creates a base::data.frame. The base::data.frame is modified and augmented with columns to assist later routines.
ReadCsvNlsy79Gen1(filePath = NULL, dsExtract = NULL)
A base::data.frame to facilitate biometric analysis.
A path to the CSV file. Remember to use double back-slashes in Windows, or forward-slashes in Windows or Linux.
A 'data.frame' (containing the extract) can be passed instead of the file path if the data has already been read into R's memory.
Will Beasley
The function does seven things.
Reads the CSV into a base::data.frame.
Checks that the NLSY variables C00001.00 and C00002.00 exist in the base::data.frame.
C00001.00
C00002.00
The NLSY variable C00001.00 is renamed SubjectID.
SubjectID
A variable named Generation is given a value of 2 for all subjects.
Generation
The SubjectTag variable is created.
SubjectTag
The NLSY variable C00002.00 is multiplied by 100 and renamed SubjectTagOfMother.
SubjectTagOfMother
The NLSY variable R00001.49 (ie, their Mother's HHID is attached to each Gen2 record).
R00001.49
HHID
if (FALSE) { filePathGen2 <- "~/Nlsy/Datasets/gen2-birth.csv" ds <- ReadCsvNlsy79Gen2(filePath = filePathGen2) }
Run the code above in your browser using DataLab