Create a table with processes, their inputs (use) and their outputs (supply).
build_supply_use(
cbs_version = NULL,
feed_intake_version = NULL,
primary_prod_version = NULL,
primary_residues_version = NULL,
processing_coefs_version = NULL
)A tibble with the supply and use data for processes. It contains the following columns:
year: The year in which the recorded event occurred.
area_code: The code of the country where the data is from. For code
details see e.g. add_area_name().
proc_group: The type of process taking place. It can be one of:
crop_production: Production of crops and their residues, e.g. rice
production, coconut production, etc.
husbandry: Animal husbandry, e.g. dairy cattle husbandry, non-dairy
cattle husbandry, layers chickens farming, etc.
processing: Derived subproducts obtained from processing other items.
The items used as inputs are those that have a non-zero processing use in
the commodity balance sheet. See get_wide_cbs() for more details.
In each process there is a single input. In some processes like olive oil
extraction or soyabean oil extraction this might make sense. Others like
alcohol production need multiple inputs (e.g. multiple crops work), so
in this data there would not be a process like alcohol production but
rather a virtual process like 'Wheat and products processing', giving
all its possible outputs. This is a constraint because of how the data was
obtained and might be improved in the future. See
get_processing_coefs() for more details.
proc_cbs_code: The code of the main item in the process taking place.
Together with proc_group, these two columns uniquely represent a
process. The main item is predictable depending on the value of
proc_group:
crop_production: The code is from the item for which seed usage
(if any) is reported in the commodity balance sheet (see
get_wide_cbs() for more). For example, the rice code for a rice
production process or the cottonseed code for the cotton production one.
husbandry: The code of the farmed animal, e.g. bees for beekeeping,
non-dairy cattle for non-dairy cattle husbandry, etc.
processing: The code of the item that is used as input, i.e., the one
that is processed to get other derived products. This uniquely defines a
process within the group because of the nature of the data that was used,
which you can see in get_processing_coefs().
For code details see e.g. add_item_cbs_name().
item_cbs_code: The code of the item produced or used in the process.
Note that this might be the same value as proc_cbs_code, e.g., in rice
production process for the row defining the amount of rice produced or
the amount of rice seed as input, but it might also have a different
value, e.g. for the row defining the amount of straw residue from rice
production. For code details see e.g. add_item_cbs_name().
type: Can have two values:
use: The given item is an input of the process.
supply: The given item is an output of the process.
value: Quantity in tonnes.
File version passed to get_wide_cbs() call.
File version passed to get_feed_intake() call.
File version passed to
get_primary_production() call.
File version passed to
get_primary_residues() call.
File version passed to
get_processing_coefs() call.
# Note: These are smaller samples to show outputs, not the real data.
# For all data, call the function with default versions (i.e. no arguments).
build_supply_use(
cbs_version = "example",
feed_intake_version = "example",
primary_prod_version = "example",
primary_residues_version = "example",
processing_coefs_version = "example"
)
Run the code above in your browser using DataLab