clean_names: Clean names

View source: R/clean-names.R

clean_namesR Documentation

Clean names

Description

This function cleans raw first and last names by removing titles (e.g., Dr.) and replacing nicknames with standard names (e.g., Billy to William). It creates a new dataset with cleaned first names, middle initials, and last names.

Usage

clean_names(
  in_path,
  file_name,
  lname_col,
  fname_col,
  sex_col,
  other_cols,
  out_path,
  middle
)

Arguments

in_path

Path to the directory where the input file is located

file_name

Input filename

lname_col

Raw last name column in the input file

fname_col

Raw first name column in the input file

sex_col

Sex column in the input file (1=male, 2=female)

other_cols

Other columns to be kept from the input file

out_path

Path to the directory where the output file will be saved

middle

Middle initial column in the input file


caseybreen/wcensoc documentation built on Nov. 21, 2024, 5:15 a.m.