Skip to content

PBCAR/Heatmaps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Heatmaps

The heatmap script utilizes 'pairwise complete' observations, meaning only individuals with missing data for the 2 variables being compared will be removed. This script includes the option of saving correlation coefficients, p-values, and the number of observations included for each pairwise correlation. These files will save in the working directory set at the top of the script, and are named 'heatmap_coefficients.csv', 'heatmap_pvalues.csv', 'heatmap_nvalues.csv', respectively.

To calculate correlations amongst variables, data are required to be in the wide format - subsequently being changed into long format for data visualization (which is done efficiently without user input in the script). The example is of a data set in wide format, with the variable names "Variable_1" through to "Variable_5". These are placed in a different order (as seen in the plot above) so that they read from left to right and bottom to top of the heatmap. They are subsequently renamed (abbreviated) for the final heatmap.

Packages:

This script uses the ggplot2, Hmisc and reshape2 packages.

Releases

No releases published

Packages

No packages published

Languages