Learn R Programming

sparkTable (version 1.3.0)

showSparkTable-methods: Look at your sparkTable in a shiny App

Description

~~ Methods for function showSparkTable ~~

Usage

showSparkTable(object, outputDir=tempdir(),outputType="html", filename=NULL, graphNames="out", ...)

Arguments

object
an object of class 'sparkTable' or 'data.frame'
outputDir
a path to a directory for the output (Default=temporary directory)
outputType
a character vector of length one specifying the desired output format:
  • 'tex': latex output is produced (does not work)
  • 'html': html output is procuded
filename
the filename of the output (minus '.tex' or '.html'
graphNames
the main part of the single graphic files that are produced (minus '-someIndex.extension'
...
additional parameters to be passed to export and summaryST

Methods

See Also

export

Examples

Run this code
## Not run: 
# data(pop,package="sparkTable")
# b <- newSparkBox()
# l <- newSparkLine()
# bb <- newSparkBar()
# content <- list(function(x) { round(mean(x),2) },
#   b,
#   l,
#   bb,
#   function(x) { round(tail(x,1),2) }
# )
# names(content) <- paste("column",1:length(content),sep="")
# varType <- rep("value",length(content))
# pop <- pop[,c("variable","value","time")]
# pop$time <- as.numeric(as.character(pop$time))
# xx <- reshapeExt(pop, varying=list(2))
# x1 <- newSparkTable(xx, content, varType)
# showSparkTable(x1)
# 
# #Example Hist+Box with 2 variables in 10 different groups
# datEx <- data.frame(
#   variable=sample(paste("Cat",1:10,sep="_"),1000,replace=TRUE),
#   value=rnorm(1000),value2=rlnorm(1000)
# )
# b <- newSparkBox()
# h <- newSparkHist()
# content <- list(
#   function(x) { round(mean(x),2) },
#   function(x) { round(median(x),2) },
#   function(x) { round(quantile(x,.25),2) },
#   function(x) { round(quantile(x,.75),2) },
#   b,
#   h,
#   function(x) { round(mean(x),2) },
#   function(x) { round(median(x),2) },
#   function(x) { round(quantile(x,.25),2) },
#   function(x) { round(quantile(x,.75),2) },
#   b,
#   h
# )
# names(content) <- c(
#   paste(c("Mean","Median","Q25","Q75","Boxplot","Histogram"),"_v1",sep=""),
#   paste(c("Mean","Median","Q25","Q75","Boxplot","Histogram"),"_v2",sep="")
# )
# varType <- c(rep("value",length(content)/2),rep("value2",length(content)/2))
# datEx <- reshapeExt(datEx, varying=list(2,3))
# x2 <- newSparkTable(datEx, content, varType)
# showSparkTable(x2)
# 
# #Example for the data.frame method (uses summaryST)
# data2 <- data.frame(x1=rnorm(100),x2=rnorm(100)+1,x3=rnorm(100)+5)
# showSparkTable(data2)
# ## End(Not run)

Run the code above in your browser using DataLab