icd9toPheWAS {EHRtemporalVariability} | R Documentation |
Function to transform ICD9-CM codification into PheWAS code
Description
Given a data.frame
object with a column of ICD9-CM codes, it generates a
new data.frame
object with the ICD9-CM codes transformed into PheWAS codes.
Usage
icd9toPheWAS(
data,
icd9ColumnName,
missingValues = "NA",
phecodeDescription = FALSE,
statistics = FALSE,
replaceColumn = TRUE,
verbose = FALSE
)
Arguments
data |
A |
icd9ColumnName |
The name of the column containing the ICD9-CM. |
missingValues |
The value used to determine missing values in the data.frame. |
phecodeDescription |
By default |
statistics |
By default |
replaceColumn |
By default |
verbose |
By default |
Value
An object of class data.frame
with the ICD9-CM column transform into
PheWAS codes.
Examples
dataset <- read.csv2(system.file("extdata",
"nhdsSubset.csv",
package="EHRtemporalVariability"),
sep = ",",
header = TRUE,
na.strings = "",
colClasses = c( "character", "numeric", "factor",
"numeric" , rep( "factor", 22 ) ) )
datasetPheWAS <- icd9toPheWAS( data = dataset,
icd9ColumnName = "diagcode1",
missingValues = "N/A",
replaceColumn = TRUE,
statistics = TRUE
)