{"action":"created","issue":{"url":"https://api.github.com/repos/mtennekes/treemap/issues/15","labels_url":"https://api.github.com/repos/mtennekes/treemap/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/mtennekes/treemap/issues/15/comments","events_url":"https://api.github.com/repos/mtennekes/treemap/issues/15/events","html_url":"https://github.com/mtennekes/treemap/issues/15","id":58945112,"number":15,"title":"Customise labels (for example add aggregate information)","user":{"login":"mpikoula","id":7785458,"avatar_url":"https://avatars.githubusercontent.com/u/7785458?v=3","gravatar_id":"","url":"https://api.github.com/users/mpikoula","html_url":"https://github.com/mpikoula","followers_url":"https://api.github.com/users/mpikoula/followers","following_url":"https://api.github.com/users/mpikoula/following{/other_user}","gists_url":"https://api.github.com/users/mpikoula/gists{/gist_id}","starred_url":"https://api.github.com/users/mpikoula/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpikoula/subscriptions","organizations_url":"https://api.github.com/users/mpikoula/orgs","repos_url":"https://api.github.com/users/mpikoula/repos","events_url":"https://api.github.com/users/mpikoula/events{/privacy}","received_events_url":"https://api.github.com/users/mpikoula/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-25T18:11:20Z","updated_at":"2015-02-27T13:11:53Z","closed_at":null,"body":"First of all thanks for an amazing package, I'm still exploring it and it's really great and comprehensively written. \r\n\r\nI am however an R beginner, and have been trying to add a modification for enabling me to print out aggregate information (so sums, or percentages) below the labels. Do you have a suggestion of a starting point for me perhaps?\r\n\r\nCheers,\r\n\r\nMaria"},"comment":{"url":"https://api.github.com/repos/mtennekes/treemap/issues/comments/76392013","html_url":"https://github.com/mtennekes/treemap/issues/15#issuecomment-76392013","issue_url":"https://api.github.com/repos/mtennekes/treemap/issues/15","id":76392013,"user":{"login":"mtennekes","id":2444081,"avatar_url":"https://avatars.githubusercontent.com/u/2444081?v=3","gravatar_id":"","url":"https://api.github.com/users/mtennekes","html_url":"https://github.com/mtennekes","followers_url":"https://api.github.com/users/mtennekes/followers","following_url":"https://api.github.com/users/mtennekes/following{/other_user}","gists_url":"https://api.github.com/users/mtennekes/gists{/gist_id}","starred_url":"https://api.github.com/users/mtennekes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mtennekes/subscriptions","organizations_url":"https://api.github.com/users/mtennekes/orgs","repos_url":"https://api.github.com/users/mtennekes/repos","events_url":"https://api.github.com/users/mtennekes/events{/privacy}","received_events_url":"https://api.github.com/users/mtennekes/received_events","type":"User","site_admin":false},"created_at":"2015-02-27T13:11:53Z","updated_at":"2015-02-27T13:11:53Z","body":"There is no direct way to do this. A trick that may work is: calculate the aggregates, and add them to you factor levels. For example:\r\n\r\nlibrary(treemap)\r\ndata(business)\r\n\r\ntotals <- round(tapply(business$turnover, INDEX = list(business$NACE1), FUN = sum, na.rm=TRUE))\r\nlevels(business$NACE1) <- paste(levels(business$NACE1), totals, sep=\": \")\r\n\r\ntreemap(business, index = c(\"NACE1\", \"NACE2\"), vSize=\"turnover\")\r\n"}}