insert_column | R Documentation |
These convenience functions wrap cbind
or rbind
for huxtables, to insert
a single row or column.
insert_column(
ht,
...,
after = 0,
fill = NULL,
rowspan = 1,
copy_cell_props = TRUE
)
insert_row(
ht,
...,
after = 0,
fill = NULL,
colspan = 1,
copy_cell_props = TRUE
)
ht |
A huxtable. |
... |
Cell contents. |
after |
Insert the row/column after this position. 0 (the default) inserts as the first row/column. |
fill |
String. If |
rowspan , colspan |
Scalar integer. Sets the rowspan or colspan of the first cell only.
The default |
copy_cell_props |
Copy cell properties from the previous row or column (if after > 0). See |
In insert_column
only, you can use a column name for after
.
Even if colspan
or rowspan
are greater than 1, you must still provide
values for the hidden cells. Use fill = ""
for this.
The modified huxtable
add_rows()
and add_columns()
, which insert multiple rows/columns at once.
insert_row(jams,
c("Gooseberry", 2.15),
after = 1
)
insert_column(jams,
c("Sugar", "50%", "60%", "40%"),
after = "Price"
)
insert_column(jams,
"Sugar",
after = "Price",
fill = "50%"
)
# don't forget to use `fill`:
insert_row(jams,
"Jams and prices",
fill = "",
colspan = 2
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.