add_decimal {icdcomorbid}R Documentation

Insert decimals to the ICD codes

Description

This is a preprocessing step to standardize the icd codes to have decimals.

Usage

add_decimal(df, icd_cols, places = 3)

Arguments

df

The dataframe to be converted.

icd_cols

A character vector specifying the names of the columns containing ICD codes.

places

An numeric value specifying the number of decimal places. Default is 3 decimal places.

Value

A dataframe in wide format where each row represents a unique identifier (ID), and each column contains a variable associated with that ID.

Examples

df <- data.frame(
  id = c(1, 2, 3),
  icd_1 = c("C509", "D633", "I210"),
  icd_2 = c("D509", "E788", "N183")
)
add_decimal(df, icd_cols = c("icd_1", "icd_2"), places = 3)

[Package icdcomorbid version 1.0.0 Index]