These functions combine two huxtables or similar objects and return the result.
add_rows(x, y, after = nrow(x), copy_cell_props = TRUE) add_columns(x, y, after = ncol(x), copy_cell_props = TRUE)
x, y | Huxtables or objects that can be converted by as_hux |
---|---|
after | Row or column after which |
copy_cell_props | Logical. Passed to |
A huxtable.
Arguments in ...
can include copy_cell_props
.
insert_row()
and insert_column()
, which insert
multiple values into a single row.
#> Error: ncol(obj1) is not NULL or ncol(obj2) is not NULL or ncol(obj1) not equal to ncol(obj2)add_rows(jams, ht, after = 1)#> Error: ncol(obj1) is not NULL or ncol(obj2) is not NULL or ncol(obj1) not equal to ncol(obj2)mx <- matrix( c("Sugar", "50%", "60%", "40%", "Weight (g)", 300, 250, 300), 4, 2) add_columns(jams, mx)#> Type Price Sugar Sugar Weight (g) #> content #> Strawberry 1.90 40.00% 50.00% 300.00 #> Raspberry 2.10 35.00% 60.00% 250.00 #> Plum 1.80 50.00% 40.00% 300.00 #> #> Column names: Type, Price, Sugar, , .1