clean_data: clean_data

Description Usage Arguments Value

Description

This function cleans the raw data by performing the following steps:

  1. Remove leading and trailing whitespace from any character fields!

  2. Replace any instances of NULL or #N/A in character fields with NA

  3. Convert the following columns to factors: AgeBand, EthnicGroup, Sex, AdmissionMethodCode, AdmissionType, CSPLastWard

  4. Convert the following columns from character to Date format: the following columns of the raw data: AdmissionDate, DischargeDate, EpisodeStartDate, EpisodeEndDate

Usage

1
clean_data(df, restrict_disch_date = TRUE)

Arguments

df

the data frame containing the episode data to be cleaned

Value

A data frame containing the cleaned data


HorridTom/clahrcnwlhf documentation built on May 7, 2019, 4:02 a.m.