| add_item_prod_name | R Documentation |
Add a new column to an existing tibble with the corresponding name for each production item code. The codes are assumed to be from those defined by FAOSTAT.
add_item_prod_name(
table,
code_column = "item_prod_code",
name_column = "item_prod_name"
)
table |
The table that will be modified with a new column. |
code_column |
The name of the column in |
name_column |
The name of the output column containing the names. |
A tibble with all the contents of table and an extra column
named name_column, which contains the names. If there is no name match,
an NA is included.
table <- tibble::tibble(item_prod_code = c(27, 358, 12345))
add_item_prod_name(table)
table |>
dplyr::rename(my_item_prod_code = item_prod_code) |>
add_item_prod_name(code_column = "my_item_prod_code")
add_item_prod_name(table, name_column = "my_custom_name")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.