fill_labels | R Documentation |
Fills missing values in row and column labels for a pivot table. By default, columns are filled down and rows are filled right.
fill_labels(pt, down, right)
## S3 method for class 'pivot_table'
fill_labels(pt, down = TRUE, right = TRUE)
pt |
A |
down |
A boolean, fill down. |
right |
A boolean, fill right. |
A pivot table should only contain label rows and columns, and an array of values, usually numeric data. The row and column closest to the data array are not filled (they must have data defined for each cell).
To correctly carry out this operation, the number of rows and columns that contain labels must be defined, and the table must only contain the pivot table rows and columns.
A pivot_table
object.
pivot_table
Other pivot table transformation functions:
extract_labels()
,
fill_values()
,
remove_agg()
,
remove_bottom()
,
remove_cols()
,
remove_empty()
,
remove_k()
,
remove_left()
,
remove_right()
,
remove_rows()
,
remove_top()
,
replace_dec()
,
unpivot()
pt <-
pt_ex |>
remove_top(1) |>
define_labels(n_col = 2, n_row = 2) |>
fill_labels(down = TRUE, right = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.