Skip to content

Commit

Permalink
CRAN VERSION 2.4-1
Browse files Browse the repository at this point in the history
  • Loading branch information
mtennekes committed Mar 28, 2016
1 parent 0224354 commit 8115050
Show file tree
Hide file tree
Showing 19 changed files with 85 additions and 271 deletions.
19 changes: 0 additions & 19 deletions build.R

This file was deleted.

16 changes: 0 additions & 16 deletions build.bash

This file was deleted.

13 changes: 0 additions & 13 deletions build.bat

This file was deleted.

36 changes: 36 additions & 0 deletions build/build_GNI_data.R
@@ -0,0 +1,36 @@
library(tmap)

## load world country data

download.file("http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/50m/cultural/ne_50m_admin_0_countries_lakes.zip", "./build/ne_50m_admin_0_countries_lakes.zip")
unzip("./build/ne_50m_admin_0_countries_lakes.zip", exdir="./build")
world50 <- read_shape("./build/ne_50m_admin_0_countries_lakes.shp")

## load worlbank GNI data
#http://data.worldbank.org/data-catalog/GNI-per-capita-Atlas-and-PPP-table


x <- read.csv("build/GNIPC.csv", skip=7, header = FALSE, stringsAsFactors = FALSE)

x <- x[!is.na(x[[1]]) & !x[[4]]=="" & !x[[5]] %in% c("", "..", letters), c(1,4,5)]
x <- x[1:(which(x[[1]]=="WLD")-1), ]
names(x) <- c("iso3", "country", "GNI")
x$GNI <- as.integer(gsub(",", "", x$GNI, fixed=TRUE))
x[!x$iso3 %in% world50$iso_a3,]
x$iso3[x$iso3=="ROM"] <- "ROU"
x$iso3[x$iso3=="ZAR"] <- "COD"

GNI2014 <- cbind(x, world50@data[match(x$iso3, world50$iso_a3), c("continent", "pop_est")])[c("iso3", "country", "continent", "pop_est", "GNI")]
names(GNI2014)[4] <- "population"

ids <- which(!GNI2014$iso3 %in% world50$iso_a3)
GNI2014[ids, ]

# retrieved from Wiki on 2015-03-25
GNI2014$continent[ids] <- c("Europe", "Oceania", "Europe", "Asia", "Asia")
GNI2014$population[ids] <- c(79218 , 10640 , 1859203, 4550368 , 1201542)

grep("I_WAS_NOT_ASCII", iconv(GNI2014$country, "latin1", "ASCII", sub="I_WAS_NOT_ASCII"))
GNI2014$country[c(145, 149)] <- c("Sao Tome and Principe", "Cote d'Ivoire")

save(GNI2014, file = "./pkg/data/GNI2014.rda", compress = "xz")
18 changes: 0 additions & 18 deletions build/roxygen.r

This file was deleted.

4 changes: 2 additions & 2 deletions examples/treemap.R
@@ -1,8 +1,8 @@
#########################################
### quick example with Gross National Income data
#########################################
data(GNI2010)
treemap(GNI2010,
data(GNI2014)
treemap(GNI2014,
index=c("continent", "iso3"),
vSize="population",
vColor="GNI",
Expand Down
6 changes: 4 additions & 2 deletions pkg/DESCRIPTION
@@ -1,14 +1,16 @@
Package: treemap
Type: Package
Title: Treemap Visualization
Version: 2.4
Date: 2015-10-14
Version: 2.4-1
Date: 2016-03-26
Author: Martijn Tennekes
Maintainer: Martijn Tennekes <mtennekes@gmail.com>
Description: A treemap is a space-filling visualization of hierarchical
structures. This package offers great flexibility to draw treemaps.
License: GPL-3
LazyLoad: yes
Depends:
R (>= 2.10)
Imports:
colorspace,
data.table (>= 1.8.8),
Expand Down
4 changes: 4 additions & 0 deletions pkg/NEWS
@@ -1,3 +1,7 @@
version 2.4-1
- fixed bug related to sortID
- updated GNI data

version 2.4
- added mapping argument to support manual palette mappings (see new vignette)
- added standard error aggregations
Expand Down
15 changes: 9 additions & 6 deletions pkg/R/datasets.R
Expand Up @@ -5,14 +5,17 @@
#' @name business
#' @references
#' \href{http://en.wikipedia.org/wiki/Statistical_Classification_of_Economic_Activities_in_the_European_Community}{Statistical Classification of Economic Activities in the European Community (NACE)}
#' \href{http://epp.eurostat.ec.europa.eu/portal/page/portal/european_business/introduction}{Eurostat - Structural business statistics (SBS)}
#' \href{http://ec.europa.eu/eurostat/web/structural-business-statistics}{Eurostat - Structural business statistics (SBS)}
{}

#' GNI 2010 Data
#' GNI 2014 Data
#'
#' Gross national income (per capita) in dollars per country in 2010.
#' Gross national income (per capita) in dollars and population totals per country in 2014.
#'
#' The GNI numbers from the World Bank are based on the Atlas. The population data are taken from Natural Earth Data.
#'
#' @name GNI2010
#' @name GNI2014
#' @references
#' \href{http://data.worldbank.org/data-catalog/health-nutrition-and-population-statistics}{Website of The World Bank - Health Nutrition and Population Statistics}
{}
#' \href{http://data.worldbank.org/data-catalog/GNI-per-capita-Atlas-and-PPP-table}{The World Bank - GNI per capita ranking}
#' \href{http://www.naturalearthdata.com/}{Natural Earth Data}
{}
9 changes: 0 additions & 9 deletions pkg/R/pkg.R
@@ -1,14 +1,5 @@
#' Treemap package
#'
#' \tabular{ll}{
#' Package: \tab treemap\cr
#' Type: \tab Package\cr
#' Version: \tab 2.4\cr
#' Date: \tab 2015-10-14\cr
#' License: \tab GPL-3\cr
#' LazyLoad: \tab yes\cr
#' }
#'
#' A treemap is a space-filling visualization of hierarchical structures. This package offers great flexibility to draw treemaps.
#'
#' The main function is \code{\link{treemap}}. See also \code{\link{itreemap}} for a graphical user interface to create treemaps. By default Tree Colors are used, which are colors from the HCL color space. Use \code{\link{treecolors}} to experiment with the parameter settings.
Expand Down
20 changes: 10 additions & 10 deletions pkg/R/treemap.R
Expand Up @@ -255,16 +255,16 @@ treemap <-
}

if (is.na(title.legend[1])) {
options(warn=-1)
if (!is.null(vColor)) {
if (type=="dens")
title.legend <- formatColorTitle(var=vColor, var2=vSize,
var2X=vColorX, div=vColorDiv)
else
title.legend <- formatColorTitle(var=vColor, varX=vColorX,
div=vColorDiv)
} else title.legend <- ""
options(warn=0)
suppressWarnings({
if (!is.null(vColor)) {
if (type=="dens")
title.legend <- formatColorTitle(var=vColor, var2=vSize,
var2X=vColorX, div=vColorDiv)
else
title.legend <- formatColorTitle(var=vColor, varX=vColorX,
div=vColorDiv)
} else title.legend <- ""
})
}

# algorithm
Expand Down
Binary file removed pkg/data/GNI2010.rda
Binary file not shown.
Binary file added pkg/data/GNI2014.rda
Binary file not shown.
12 changes: 0 additions & 12 deletions pkg/man/GNI2010.Rd

This file was deleted.

16 changes: 16 additions & 0 deletions pkg/man/GNI2014.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/man/business.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 1 addition & 10 deletions pkg/man/treemap-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/man/treemap.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

151 changes: 0 additions & 151 deletions pkg/vignettes/treemap_color_palettes_mapping.html

This file was deleted.

0 comments on commit 8115050

Please sign in to comment.