I have a tab delimited text file with a header (sample metrics), and 1st column contains sample names, hypothetically something like this:
My actual table has 13 columns.
I would like the sample names to be row labels on the heatmap, and Metrics (European, Asian, African) to be column labels.
Using this simple script, the column labels got printed, but the row labels did not. Any suggestions on how to add the row labels (sample names) to the heatmap:
filename <- "Data.txt"
# Read the data into a data frame
my_data <- read.table(filename, sep ="\t", quote = "", stringsAsFactors = FALSE,header = TRUE)
# Make the heatmap data into a matrix
my_matrix <- as.matrix(my_data[ ,c(2:13)]) # [all rows, columns 2-13]
# Make heatmap
Here is my heatmap which shows that the row labels did not print