lar (version 0.1-2)

draw.lar: Draw Labour Relations

Description

This function draws a treemap of labour relations (http://historicallabourrelations.org). It is a convenience wrapper for the Treemap package by Martijn Tennekens. Before this function is used, data should be setup in a specific data format (see read.lar()).

Usage

draw.lar(data.frame, sex)

Arguments

data.frame
A data.frame in labour relations format. Required. See read.lar for more information on the format.
sex
One of "total" (default), "male", "female", to indicate respectively: the total population, the male population or the female population.

References

Project website: http://historyoflabourrelations.org

See Also

read.lar, treemap.

Examples

Run this code
  ## Not run:  
#   ## First read in a labour relations pre-defined excel file:
#   df <- read.lar("Spain_1900_(JMTL-Sept2011).xlsx")
# 
#   ## Next, draw a treemap of the labour relations:
#   draw.lar(df)
#   
#   ## Treemap with example data set for Spain in 1900
#   data(spain.1900)
#   draw.lar(spain.1900)
#   
#   ## Save treemap image as .png
#   data(spain.1900)
#   ppi <- 300  # define pixels: increase this number for even better quality
#   png(file = "tm_spain_1900.png",
#       , width=10*ppi, height=8*ppi, res=ppi)
#   draw.lar(spain.1900)
#   dev.off() 
#   ## End(Not run)

Run the code above in your browser using DataLab