Description Usage Arguments Value Replacing existing rows and columns Adding new rows and columns Examples
Subset a huxtable
1 2 3 4 5 6 7 8 9 10 11 |
x |
A huxtable. |
i |
Rows to select. |
j, name |
Columns to select. |
drop |
Only included for compatibility with |
value |
A matrix, data frame, huxtable or similar object. |
[
returns a huxtable. $
and [[
return data from the
underlying data frame.
For the replacement function [<-
, if value
is a huxtable, then its
properties will be copied into x
. Replacement functions $<-
and [[<-
replace existing data without affecting any properties.
If new columns or rows are created, then properties will be copied
from the last column or row of x
, or from value
if value
is a huxtable.
These methods are stricter than their data frame equivalents in some places. You can't add new rows or column at a numeric location without specifying all intervening rows/columns. New values must have the appropriate dimensions (vectors will be interpreted appropriately).
1 2 3 4 5 6 7 8 9 10 11 12 13 |
Type Price
Strawberry 1.90
Raspberry 2.10
Column names: Type, price
[1] "huxtable" "data.frame"
Type
Strawberry
Raspberry
Plum
Column names: Type
[1] "Type" "Strawberry" "Raspberry" "Plum"
Type Price
Strawberry 1.70
Raspberry 2.00
Plum 2.20
Column names: Type, price
Type Price
Strawberry 1.70
Raspberry 2.00
Plum 2.20
Column names: Type, price
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.