remove_empty | R Documentation |
Remove rows and columns without data from the pivot table represented by the object.
remove_empty(pt)
## S3 method for class 'pivot_table'
remove_empty(pt)
pt |
A |
A pivot table should only contain label rows and columns, and an array of values, usually numeric data.
All rows and columns not belonging to the pivot table must be removed, including those without data.
A pivot_table
object.
pivot_table
Other pivot table transformation functions:
extract_labels()
,
fill_labels()
,
fill_values()
,
remove_agg()
,
remove_bottom()
,
remove_cols()
,
remove_k()
,
remove_left()
,
remove_right()
,
remove_rows()
,
remove_top()
,
replace_dec()
,
unpivot()
df <- df_ex
df[seq(from = 1, to = 25, by = 2), ] <- " "
df[, seq(from = 1, to = 7, by = 2)] <- " "
pt <- pivot_table(df)
pt <- pt |> remove_empty()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.