Learn R Programming

sparkTable (version 1.3.0)

newGeoTable: Functions to create a new object of class 'geoTable'

Description

User-function to create objects of the class 'geoTable'.

Usage

newGeoTable(dataObj, tableContent, varType, geographicVar, geographicInfo=NULL)

Arguments

dataObj
a data frame containing information to be plotted.
tableContent
a list with elements of class 'sparkline','sparkbox','sparkbar' or 'function'
varType
a character vector containing variable names existing in dataObj.
geographicVar
a character variable of length 1 with a variable name of dataObj that holds regional information.
geographicInfo
if specified, a data.frame containing 3 columns.
  • first column: row-indices
  • second column: column-indices
  • third column: regional codes

See Also

export

Examples

Run this code
  ## Not run: 
#   ###Example EU population and debt
#   data(popEU,package="sparkTable")
#   data(debtEU,package="sparkTable")
#   data(coordsEU,package="sparkTable")
#   popEU <- popEU[popEU$country%in%coordsEU$country,]
#   debtEU <- debtEU[debtEU$country%in%coordsEU$country,]
#   EU <- cbind(popEU,debtEU[,-1])
#   EUlong <- reshapeExt(EU,idvar="country",v.names=c("pop","debt"),
#     varying=list(2:13,14:25),geographicVar="country",timeValues=1999:2010)
#   l <- newSparkLine()
#   l <- setParameter(l, 'lineWidth', 2.5)
#   content <- list(function(x){"Population:"},l,function(x){"Debt:"},l)
#   varType <- c(rep("pop",2),rep("debt",2))
#   xGeoEU <- newGeoTable(EUlong, content, varType,geographicVar="country",
#     geographicInfo=coordsEU)
#   ## End(Not run)

Run the code above in your browser using DataLab