Learn R Programming

healthcareai (version 1.2.4)

calculateTargetedCorrelations: Correlation analysis on an input table, focusing on one target variable

Description

Calculates correlations between each numeric column in a table and and a target column

Usage

calculateTargetedCorrelations(df, targetCol)

Arguments

df

A data frame

targetCol

Name of target column against which correlations will be calculated

Value

A data frame with column names and corresponding correlations and p-values with the target column

References

http://healthcareai-r.readthedocs.io

See Also

healthcareai

Examples

Run this code
# NOT RUN {
df <- data.frame(a=c(1,2,3,4,5,6),
b=c(6,5,4,3,2,1),
c=c(3,4,2,1,3,5),
d=c('M','F','F','F','M','F')) #<- is ignored

dfResult <- calculateTargetedCorrelations(df=df,targetCol='c')
dfResult
# }

Run the code above in your browser using DataLab