hm_cell {HKRbook} | R Documentation |
hm_cell
Description
-
hm_cell
orhm_index
modify a data cell format (fmt="%s"
), value (unnamed parameter) or style (text_align="left"
) -
hm_col
orhm_row
modify a row or column format (fmt="%s"
), value (unnamed parameter) or style (text_align="left"
)
Usage
hm_cell(x, row = NULL, col = NULL, ..., byrow = FALSE)
hm_index(x, ind, ...)
hm_title(x, ...)
hm_colmargintitle(x, ...)
hm_rowmargintitle(x, ...)
hm_total(x, ...)
hm_table(x, ...)
hm_row(x, ind, ...)
hm_col(x, ind, ...)
hm_colmargin(x, ind, ...)
hm_rowmargin(x, ind, ...)
hm_tr(x, ind, ...)
Arguments
x |
html_matrix object |
row |
integer: row(s) to access |
col |
integer: column(s) to access |
... |
elements to change |
byrow |
logical: order indices by row or column (default: |
ind |
integer vector or matrix: access various (row and columns) elements (first column: row, second column: column) |
Value
modified html_matrix object
Examples
l <- html_matrix(matrix(1:6, ncol=2))
# replace l[1,1] by NA
hm_cell(l, 1, 1, NA)
# replace l[1,1] by NA and set the text_align to center
hm_cell(l, 1, 1, NA, text_align="center")
# replace l[1,3] and l[2,1] by NA
rcind <- cbind(c(1,3), c(2, 1))
hm_index(l, rcind, NA)
# set a new title
hm_title(l, "new title")
# set a new row or column title
hm_row(l, 2, "row 2")
hm_col(l, 1, "col 1")
# set fmt by column or row
print(hm_cell(l, fmt=c("%.0f", "%.1f", "%.2f"), byrow=FALSE), which="fmt")
print(hm_cell(l, fmt=c("%.0f", "%.1f"), byrow=TRUE), which="fmt")
[Package HKRbook version 0.1.3 Index]