convert_to_rds: Convert all PSID files from .txt format to .rds format

Description Usage Arguments Examples

View source: R/2convert_to_rds.R

Description

Converts all PSID fixed width format .txt files in a selected directory into .rds format. Importantly, this function assumes that all files contained in the original PSID .zip files (especially those ending in .do) are present in the same directory as the PSID .txt files, and that all files within that directory have the same names as when first unzipped.

Usage

1
convert_to_rds(in_direc, out_direc)

Arguments

in_direc

Directory containing unzipped PSID .txt and .do files

out_direc

Directory to place PSID .rds files into

Examples

1
2
3
4
convert_to_rds(
    in_direc=system.file("extdata","unzip_dir", package = "easyPSID"),
    out_direc=tempdir()
)

Example output

Loading required package: stringr
Loading required package: LaF
Loading required package: foreign
FAM1984.rds Converted

easyPSID documentation built on Oct. 3, 2021, 5:06 p.m.