setAutoFilter-methods(XLConnect)
setAutoFilter-methods()所属R语言包:XLConnect
Setting auto-filters on worksheets
在工作表上设置自动过滤器
译者:生物统计家园网 机器人LoveR
----------Description----------
Sets an auto-filter on a specified worksheet.
指定的工作表上设置一个自动过滤器。
用法----------Usage----------
## S4 method for signature 'workbook,character'
setAutoFilter(object,sheet,reference)
## S4 method for signature 'workbook,numeric'
setAutoFilter(object,sheet,reference)
参数----------Arguments----------
参数:object
The workbook to use
workbook使用
参数:sheet
The name or index of the sheet on which to set the auto-filter
的名称或索引的表上设置自动过滤器
参数:reference
A cell range specification (character) in the form 'A1:B8'
一个单元格范围的规范(character)的形式为“A1:B8
(作者)----------Author(s)----------
Martin Studer<br>
Mirai Solutions GmbH <a href="http://www.mirai-solutions.com">http://www.mirai-solutions.com</a>
参见----------See Also----------
workbook
workbook
实例----------Examples----------
# Load workbook (create if not existing)[负载工作簿(如果不存在创建)]
wb <- loadWorkbook("autofilter.xlsx", create = TRUE)
# Create a worksheet named 'mtcars'[创建一个工作表命名为“mtcars]
createSheet(wb, name = "mtcars")
# Create a named region called 'mtcars' on the sheet called 'mtcars'[创建一个命名的区域被称为“mtcars在纸张上被称为”mtcars“]
createName(wb, name = "mtcars", formula = "mtcars!$A$1")
# Write built-in data set 'mtcars' to the above defined named region[内置的数据集mtcars上述定义的命名区域写]
# (using header = TRUE)[(使用header = TRUE)]
writeNamedRegion(wb, mtcars, name = "mtcars")
# Set an auto-filter for the named region written above[上面写的命名区域设置自动过滤器]
setAutoFilter(wb, sheet = "mtcars", reference = aref("A1", dim(mtcars)))
# Save workbook (this actually writes the file to disk)[保存工作簿(这实际上是将文件写入到磁盘)]
saveWorkbook(wb)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|