Learn R Programming

iotables (version 0.9.4)

matrix_round: Round Matrix Values

Description

Round all numeric values in an input–output style table to a specified number of digits. The key column (first column) is preserved unchanged.

Usage

matrix_round(data_table, digits = 0)

Value

A data.frame (or tibble) with the key column intact and all other numeric columns rounded to the given precision.

Arguments

data_table

A symmetric input–output table, use table, supply table, tax table, or margins table.

digits

Integer number of decimal places to round to. Defaults to 0.

Details

This is useful for comparing results across software or publications that present rounded tables.

See Also

Other iotables processing functions: conforming_vector_create(), empty_remove(), household_column_find(), household_column_get(), iotable_year_get(), key_column_create(), output_get(), primary_input_get(), rows_add(), supplementary_add(), total_tax_add(), vector_transpose_longer(), vector_transpose_wider()

Examples

Run this code
de_coeff <- input_coefficient_matrix_create(iotable_get())
head(matrix_round(de_coeff, digits = 2))

Run the code above in your browser using DataLab