get_value_from_codes: Function to get the actual value of column content if its...

View source: R/IPDFilecheck.R

get_value_from_codesR Documentation

Function to get the actual value of column content if its coded

Description

Function to get the actual value of column content if its coded

Usage

get_value_from_codes(data, column, nrcode = NA, list_codes_values)

Arguments

data

a data frame

column

column name for value

nrcode

non response code corresponding to gender column

list_codes_values

list of codes to understand the codes and value

Value

0, if success error if failure

Examples

data = data.frame("sex" = c(1, 2, 2, 1, 1),
 "Name" = c("John", "Dora","Dora", "John","John"))
list_codes_values = list(c("F", "M"),c(1,2))
ans <- get_value_from_codes(data, column = "sex", nrcode = NA,
list_codes_values)

sheejamk/IPDFileCheck documentation built on March 10, 2024, 3:14 p.m.