Learn R Programming

sparkTable (version 1.3.0)

summaryST: summaryST - data frame in a graphical table

Description

summary for a data frame in a graphical table

Usage

summaryST(.Object, outputType="html", filename=NULL, graphNames="out", hist=TRUE,boxplot=TRUE,min=TRUE,quantile=TRUE,median=TRUE, mean=TRUE,max=TRUE,changeOrder=NULL,addFun=NULL,digits=2, scaleHistByCol=FALSE,scaleBoxByCol=FALSE)

Arguments

.Object
a data frame
outputType
a character vector of length one specifying the desired output format:
  • 'tex': latex output is produced
  • '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'
hist
TRUE/FALSE for a histogramm
boxplot
TRUE/FALSE for a boxplot
min
TRUE/FALSE for the minimum
quantile
TRUE/FALSE for 1st and 3rd Quartile
median
TRUE/FALSE for the median
mean
TRUE/FALSE for the mean
max
TRUE/FALSE for the maximum
changeOrder
Indices for reordering the columns of the table
addFun
named list of additional functions e.g. var
digits
number of digits used for rounding
scaleHistByCol
TRUE/FALSE if the histograms of all variables should be on the same x-axis scale
scaleBoxByCol
TRUE/FALSE if the boxplots of all variables should be on the same x-axis scale

Value

object of class 'sparkTable' for further customizing the output (with setParameter)

See Also

export

Examples

Run this code
## Not run: 
# data1 <- data.frame(x=rnorm(100),y=rlnorm(100),
#   z=rbeta(100,1,1))
# #default summary table
# summaryST(data1,filename="st1a",graphNames="out1a")
# #changing the order of the columns
# summaryST(data1,filename="st1b",changeOrder=c(6,7,2,3,1,4,5,8),graphNames="out1b")
# #adding a custom column
# summaryST(data1,filename="st1c",addFun=list(var=function(x)round(var(x,na.rm=TRUE),2)),
#   graphNames="out1c")
# 
# data2 <- data.frame(x1=rnorm(100),x2=rnorm(100)+1,x3=rnorm(100)+5)
# summaryST(data2,filename="st1d",graphNames="out1d",scaleHistByCol=TRUE,scaleBoxByCol=TRUE)
# # the same results in a shiny app:
# 
# showSparkTable(data2)
# ## End(Not run)

Run the code above in your browser using DataLab