[R] Save the result of map.market function to HTML file?

valerio orfano ingorfano at hotmail.com
Tue Jun 2 17:49:14 CEST 2015


HI All,

i need to call the tree map function in R to display my multiple disks usage, using ‘portfolio' library. I need furthermore to generate multiple page each showing the treemap of each disk. It works fine if use pdf file , but my boss wants to save the result into an html file. Any help? I’ve tried with R2HTML library without success. The output of map.market is a ‘gTree' object. Any help is appreciated.

library(portfolio)
data1 <- read.csv("C:/Users/Administrator/Desktop/prova_data1.txt", sep='\t', stringsAsFactors = FALSE)
data2 <- read.csv("C:/Users/Administrator/Desktop/prova_data2.txt", sep='\t', stringsAsFactors = FALSE)
data2 <- read.csv("C:/Users/Administrator/Desktop/prova_data3.txt", sep='\t', stringsAsFactors = FALSE)
pdf("C:/Users/Administrator/Desktop/treemap.pdf")
map.market(id = data1$Id, area = data1$size, group = data1$Storage, color = data1$col, lab=c(TRUE,TRUE), main="Test Map")
map.market(id = data2$Id, area = data2$size, group = data2$Storage, color = data2$col, lab=c(TRUE,TRUE), main="Test Map")
map.market(id = data3$Id, area = data3$size, group = data3$Storage, color = data3$col, lab=c(TRUE,TRUE), main="Test Map")
dev.off()


More information about the R-help mailing list