With any table object, you can produce a summary table that contains nothing
more than the table's dimensions: the number of rows and the number of
columns. The output summary table will have two columns and two rows. The
first is the ".param." column with the labels "rows" and "columns"; the
second column, "value", contains the row and column counts.
Examples
Get the dimensions of the game_revenue dataset that is included in the
pointblank package.
tt_tbl_dims(tbl = game_revenue)
#> # A tibble: 2 x 2
#> .param. value
#> <chr> <int>
#> 1 rows 2000
#> 2 columns 11This output table is useful when a table validation depends on its
dimensions. Here, we check that game_revenue has at least 1500 rows.
tt_tbl_dims(tbl = game_revenue) %>%
dplyr::filter(.param. == "rows") %>%
test_col_vals_gt(
columns = value,
value = 1500
)
#> [1] TRUEWe can check small_table to ensure that number of columns is less than
10.
tt_tbl_dims(tbl = small_table) %>%
dplyr::filter(.param. == "columns") %>%
test_col_vals_lt(
columns = value,
value = 10
)
#> [1] TRUESee also
Other Table Transformers:
get_tt_param(),
tt_string_info(),
tt_summary_stats(),
tt_tbl_colnames(),
tt_time_shift(),
tt_time_slice()