plotSparkTable-methods(sparkTable)
plotSparkTable-methods()所属R语言包:sparkTable
Plot objects of class 'sparkTable'
图对象类的sparkTable“
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Function that plots objects of class 'sparkTable'.
功能绘制对象的类的sparkTable“的。
用法----------Usage----------
plotSparkTable(object, outputType='html', filename=NULL, graphNames='out', ...)
参数----------Arguments----------
参数:object
an object of class 'sparkTable'
对象类的sparkTable“
参数:outputType
a character vector of length one specifying the desired output format:
字符向量的长度指定所需的输出格式:
'tex': latex output is produced
“TEX”:乳胶输出
'html': html output is procuded </ul>
“HTML”:,HTML输出procuded </ ul>
参数:filename
the filename of the output (minus '.tex' or '.html'
输出的文件名(减的tex或。的HTML“
参数:graphNames
the main part of the single graphic files that are produced (minus '-someIndex.extension'
单的图形产生的文件(减去的主要部分的 - someIndex.extension
参数:...
additional parameters to be passed
额外的参数传递
(作者)----------Author(s)----------
Bernhard Meindl, Alexander Kowarik, Statistics Austria
参见----------See Also----------
summaryST
summaryST
实例----------Examples----------
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,idvar="variable", varying=list(2))
x1 <- newSparkTable(xx, content, varType)
plotSparkTable(x1, outputType="html", graphNames="o2",filename="t1")
plotSparkTable(x1, outputType="tex", graphNames="o3",filename="t2")
#Example Hist+Box with 2 variables in 10 different groups[例如历史+盒2个变量在10个不同的组]
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,idvar="variable", varying=list(2,3))
x2 <- newSparkTable(datEx, content, varType)
plotSparkTable(x2, outputType="html", graphNames="o2",filename="t1")
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|