Learn R Programming

sparkTable (version 1.3.0)

newSparkBar: Functions to create new Spark object

Description

Basic functions to create objects of the class 'spark'. The functions are the base for creating a graphical table.

Usage

newSparkLine(width=NULL, height=NULL, values=NULL, padding=NULL, allColors=NULL, pointWidth=NULL, lineWidth=NULL, showIQR=NULL, vMin=NULL, vMax=NULL,outputType="html") newSparkBar(width=NULL, height=NULL, values=NULL, padding=NULL, barCol=NULL, barWidth=NULL, barSpacingPerc=NULL, vMin=NULL, vMax=NULL,bgCol=NULL,outputType="html") newSparkBox(width=NULL, height=NULL, values=NULL, padding=NULL, boxOutCol=NULL, boxMedCol=NULL, boxShowOut=NULL, boxCol=NULL, boxLineWidth=NULL, vMin=NULL, vMax=NULL,bgCol=NULL,outputType="html") newSparkHist(width=NULL, height=NULL, values=NULL, padding=NULL, barCol=NULL, barWidth=NULL, barSpacingPerc=NULL, vMin=NULL, vMax=NULL,bgCol=NULL,outputType="html")

Arguments

width
described in setParameter
height
described in setParameter
values
described in setParameter
padding
described in setParameter
allColors
described in setParameter
pointWidth
described in setParameter
lineWidth
described in setParameter
showIQR
described in setParameter
vMin
numeric vector of length 1 definining minimum value required for data scaling
vMax
numeric vector of length 1 definining maximum value required for data scaling
barCol
described in setParameter
barWidth
described in setParameter
barSpacingPerc
described in setParameter
boxOutCol
character vector of length 1 defining the color of outliers in spark boxplots
boxMedCol
character vector of length 1 defining the color of median line in spark boxplots
boxShowOut
logical vector specifying if outliers should be displayed in spark boxplots
boxCol
described in setParameter
boxLineWidth
described in setParameter
bgCol
described in setParameter
outputType
described in plot

See Also

plot, export, setParameter, getParameter

Examples

Run this code
  ## Not run: 
#   data(pop)
#   x <- pop[pop[,2]=="Insgesamt",3]
# 
#   ### SparkLine
#   a <- newSparkLine(values=x, pointWidth=8)
#   export(a, outputType='png', filename='testLine1')
# 
#   a <- setParameter(a, sample(1:10, 15, replace=TRUE), type='values')
#   getParameter(a, type='values')
# 
#   a <- setParameter(a, c("darkred", "darkgreen","darkblue", "white", "black", "red"),
#     type='allColors')
#   getParameter(a, type='allColors')
# 
#   a <- setParameter(a, 3, type='pointWidth')
#   a <- setParameter(a, 1, type='lineWidth')
# 
#   export(a, outputType="pdf", filename='testLine2')
# 
#   a <- setParameter(a, 6, type='width')
#   a <- setParameter(a, .6, type='height')
#   export(a, outputType='eps', filename='testLine2')
# 
#   ### SparkBar
#   b <- newSparkBar(values=x-min(x))
#   getParameter(b, type='values')
# 
#   b <- setParameter(b, c("darkred", "darkgreen","black"), type='barCol')
#   export(b, outputType='pdf', filename='testBar1')
# 
#   b <- setParameter(b, 0:10, type='values')
#   export(b, outputType='pdf', filename='testBar2')
# 
#   b <- setParameter(b, 0:-10, type='values')
#   export(b, outputType='pdf', filename='testBar3')
# 
#   ### SparkBox
#   cc <- newSparkBox(values=x)
#   cc <- setParameter(cc, "darkgreen", type='outCol')
#   getParameter(cc, type='outCol')
#   cc <- setParameter(cc, c("black","red"), type='boxCol')
# 
#   export(cc, outputType='pdf', filename='testBox1')
# 
#   cc <- setParameter(cc, c("black","darkgreen"), type='boxCol')
#   cc <- setParameter(cc, "darkred", type='outCol')
#   export(cc, outputType='pdf', filename='testBox2')
# 
#   ###SparkHist
#   hh <- newSparkHist(values=rnorm(100))
#   export(hh, outputType='pdf', filename='testHist1')
#   ## End(Not run)

Run the code above in your browser using DataLab