data <- read.csv("http://datasets.flowingdata.com/post-data.txt")
install.packages("portfolio")
library(grid)
library(lattice)
library(nlme)
library(portfolio)
map.market(id=data$id, area=data$views, group=data$category, color=data$comments, main="FlowingData Map")
#Attention:the data file shouldn't contain tabs; the first row has to have the column names; the color code value range is between around -50 to 50; the local file path shouldn't have \ but / ; have fun
reference:https://flowingdata.com/2010/02/11/an-easy-way-to-make-a-treemap/
No comments:
Post a Comment