Row: Functions to manipulate rows of a worksheet.

Description Usage Arguments Value Author(s) See Also Examples

Description

removeRow is just a convenience wrapper to remove the rows from the sheet (before saving). Internally it calls lapply.

Usage

1
2
3
4
5
6
7
createRow(sheet, rowIndex = 1:5)

getRows(sheet, rowIndex = NULL)

removeRow(sheet, rows = NULL)

setRowHeight(rows, inPoints, multiplier = NULL)

Arguments

sheet

a worksheet object as returned by createSheet or by subsetting getSheets.

rowIndex

a numeric vector specifying the index of rows to create. For getRows, a NULL value will return all non empty rows.

rows

a list of Row objects.

inPoints

a numeric value to specify the height of the row in points.

multiplier

a numeric value to specify the multiple of default row height in points. If this value is set, it takes precedence over the inPoints argument.

Value

For getRows a list of java object references each pointing to a row. The list is named with the row number.

Author(s)

Adrian Dragulescu

See Also

To extract the cells from a given row, see Cell.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
file <- system.file("tests", "test_import.xlsx", package = "xlsx")

wb <- loadWorkbook(file)
sheets <- getSheets(wb)

sheet <- sheets[[2]]
rows  <- getRows(sheet)  # get all the rows

# see all the available java methods that you can call
rJava::.jmethods(rows[[1]])

# for example
rows[[1]]$getRowNum()   # zero based index in Java

removeRow(sheet, rows)  # remove them all

# create some row
rows  <- createRow(sheet, rowIndex=1:5)
setRowHeight( rows, multiplier=3)  # 3 times bigger rows than the default

xlsx documentation built on Nov. 10, 2020, 3:52 p.m.