WBBP <- read.csv("WorldBankBestPlaces.csv", sep=",") *reads in csv to 'WBBP' data object
WBBP <- WBBP[order(WBBP$Ease.of.Doing.Business.Rank),] *orders by ranking index
row.names(WBBP) <- WBBP$Economy *labels rows with economy name
WBBP <- WBBP[,2:12] *drops economy name col (not needed after step above)
WBBP_matrix <- data.matrix(WBBP) *converts data frame to data matrix
WBBP_heatmap <- heatmap(WBBP_matrix, Rowv=NA, Colv=NA, col = heat.colors(256), scale="column", margins=c(16,8))
No comments:
Post a Comment