Description Usage Arguments Details Value Author(s) Examples
The function accepts a (file path to) CSV file and creates a data.frame
. The data.frame
is modified and augmented with columns to assist later routines.
1 2 3 | ReadCsvNlsy79Gen1(filePath, dsExtract=read.csv(filePath))
ReadCsvNlsy79Gen2(filePath, dsExtract=read.csv(filePath))
|
filePath |
A path to the CSV file. Remember to use double back-slashes in Windows, or forward-slashes in Windows or Linux. |
dsExtract |
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. |
The function does seven things.
Reads the CSV into a data.frame
.
Checks that the NLSY variables C00001.00
and C00002.00
exist in the data.frame
.
The NLSY variable C00001.00
is renamed SubjectID
.
A variable named Generation
is given a value of 2 for all subjects.
The SubjectTag
variable is created.
The NLSY variable C00002.00
is multiplied by 100 and renamed SubjectTagOfMother
.
The NLSY variable R00001.49
(ie, their Mother's HHID
is attached to each Gen2 record).
A data.frame
to facililate biometric analysis.
Will Beasley
1 2 3 4 5 | ## Not run:
filePathGen2 <- "~/Nlsy/Datasets/Gen2Birth.csv"
ds <- ReadCsvNlsy79Gen2(filePath=filePathGen2)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.