clearRange-methods(XLConnect)
clearRange-methods()所属R语言包:XLConnect
Clearing cell ranges in a workbook
清除工作簿中的单元格范围
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Clears cell ranges in a workbook.
清除单元格范围在一个workbook。
用法----------Usage----------
## S4 method for signature 'workbook,numeric'
clearRange(object, sheet, coords)
## S4 method for signature 'workbook,character'
clearRange(object, sheet, coords)
参数----------Arguments----------
参数:object
The workbook to use
workbook使用
参数:sheet
The name or index of the worksheet in which to clear cell ranges
要清除单元格范围的工作表的名称或索引
参数:coords
Numeric vector of length 4 or numeric matrix with 4 columns where the elements of the vector or rows in the matrix refer to the coordinates of the top-left and bottom-right corners of the ranges to clear. I.e. a vector or each row specifies the coordinates {top row, left column, bottom row, right column}. You may use aref2idx to generate such a matrix.
数值向量的长度为4或数值矩阵的4列的矢量或矩阵的行中的元素是指以清除的范围的左上角和右下角的角落的坐标。即的向量或每一行指定的坐标{顶行,左栏,底行,右列}。你可以使用aref2idx产生这样一个矩阵。
Details
详细信息----------Details----------
Clearing a cell range means to remove any cells associated with that range.
清除单元格范围,删除任何与该范围内的单元。
(作者)----------Author(s)----------
Nicola Lambiase<br>
Mirai Solutions GmbH <a href="http://www.mirai-solutions.com">http://www.mirai-solutions.com</a>
参见----------See Also----------
workbook, clearSheet, clearNamedRegion, clearRangeFromReference
workbook,clearSheet,clearNamedRegion,clearRangeFromReference
实例----------Examples----------
# mtcars xlsx file from demoFiles subfolder of [mtcars demoFiles子文件夹的xlsx文件]
# package XLConnect[包XLConnect]
demoExcelFile <- system.file("demoFiles/mtcars.xlsx",
package = "XLConnect")
# Load workbook[负载工作簿]
wb <- loadWorkbook(demoExcelFile)
# Clear range from top left corner (4,2) ^= B4 to[清除范围从左上角(4,2)^ = B4至]
# bottom right corner (6,4) ^= D6[右下角(6,4)^ = D6]
clearRange(wb, sheet = "mtcars", coords = c(4, 2, 6, 4))
# Clear two ranges in one go ...[清除两个范围在一个去......]
mat = matrix(c(5, 1, 6, 4, 5, 7, 7, 9), ncol = 4,
byrow = TRUE)
clearRange(wb, sheet = "mtcars", coords = mat)
# The above is equivalent to ...[以上是相当于...]
clearRange(wb, sheet = "mtcars",
coords = aref2idx(c("A56", "G5:I7")))
# This in turn is the same as ...[反过来,这是相同的...]
clearRangeFromReference(wb, reference = c("mtcars!A56",
"mtcars!G5:I7"))
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|