Skip to content

ECON304 Midterm


This is example.

 

 

# R code for ECON 304
# 11 July 2013
# Aj Champ, me@pairach.com
# Code 2 - Heatmap with NBA data

nba <- read.csv("http://datasets.flowingdata.com/ppg2008.csv", sep=",")

nba

head(nba)
names(nba)

install.packages("psych")

row.names(nba) <- nba$Name

head(nba)



nba <- nba[,2:20]

head(nba)

nba_matrix <- data.matrix(nba)


heatmap(nba_matrix)

nba_heatmap <- heatmap(nba_matrix, Rowv=NA, Colv=NA, 
                       col = heat.colors(256), 
                       scale="column", margins=c(5,10),
                       main = "Heatmap of NBA players")


No comments yet

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: