Running gcamfaostat

gcamfaostat_metadata()

gcamfaostat_metadata: generate metadata information of the input data

driver_drake()

driver_drake

driver()

driver

dstrace()

A tracing utility for the GCAM Data System.

info()

info

inputs_of()

inputs_of

load_from_cache()

load_from_cache

outputs_of()

outputs_of

create_datamap_from_cache()

create_datamap_from_cache

gcamfaostat modules

module_xfaostat_L101_RawDataPreProc1_QCL()

module_xfaostat_L101_RawDataPreProc1_QCL

module_xfaostat_L101_RawDataPreProc2_PP_PD_OA()

module_xfaostat_L101_RawDataPreProc2_PP_PD_OA

module_xfaostat_L101_RawDataPreProc3_SCL_FBS()

module_xfaostat_L101_RawDataPreProc3_SCL_FBS

module_xfaostat_L101_RawDataPreProc4_FBSH_CB()

module_xfaostat_L101_RawDataPreProc4_FBSH_CB

module_xfaostat_L101_RawDataPreProc5_TCL()

module_xfaostat_L101_RawDataPreProc5_TCL

module_xfaostat_L101_RawDataPreProc6_TM()

module_xfaostat_L101_RawDataPreProc6_TM

module_xfaostat_L101_RawDataPreProc7_FO()

module_xfaostat_L101_RawDataPreProc7_FO

module_xfaostat_L101_RawDataPreProc8_RL_RFN()

module_xfaostat_L101_RawDataPreProc8_RL_RFN

module_xfaostat_L102_ProductionArea()

module_xfaostat_L102_ProductionArea

module_xfaostat_L103_ProducerPrices()

module_xfaostat_L103_ProducerPrices

module_xfaostat_L104_ProductionAreaAddFodder()

module_xfaostat_L104_ProductionAreaAddFodder

module_xfaostat_L105_DataConnectionToSUA()

module_xfaostat_L105_DataConnectionToSUA

module_xfaostat_L106_FoodMacroNutrient()

module_xfaostat_L106_FoodMacroNutrient

module_xfaostat_L199_CSVExportAgSUA()

module_xfaostat_L199_CSVExportAgSUA

module_xfaostat_L201_Forestry()

module_xfaostat_L201_Forestry

module_xfaostat_L301_LandCover()

module_xfaostat_L301_LandCover

module_xfaostat_L401_Fertilizer()

module_xfaostat_L401_Fertilizer

gcamdata AgLU modules

module_aglu_L100.FAO_SUA_connection()

module_aglu_L100.FAO_SUA_connection

module_aglu_L100.FAO_SUA_PrimaryEquivalent()

module_aglu_L100.FAO_SUA_PrimaryEquivalent

gcamfaostat Chunk Helper Functions

FAOSTAT_metadata()

FAOSTAT_metadata: get the most recent metadata from FAOSTAT API and return a summary data frame

FF_rawdata_info()

FF_rawdata_info: extract meta info of data (e.g., zip files) in a folder

FF_download_FAOSTAT()

FF_download_FAOSTAT: Bulk download raw data from FAOSTAT API by dataset code

FF_download_RemoteArchive()

FF_download_RemoteArchive: Download raw data from remote archive (Zenodo)

FAOSTAT_load_raw_data()

FAOSTAT_load_raw_data: load raw csv data

FAOSTAT_AREA_RM_NONEXIST()

FAOSTAT_AREA_RM_NONEXIST: remove nonexistent FAO region using area_code, e.g., USSR after 1991

FAO_AREA_DISAGGREGATE_HIST_DISSOLUTION()

FAO_AREA_DISAGGREGATE_HIST_DISSOLUTION

FAO_AREA_DISAGGREGATE_HIST_DISSOLUTION_ALL()

FAO_AREA_DISAGGREGATE_HIST_DISSOLUTION_ALL

FF_FILL_NUMERATOR_DENOMINATOR()

FF_FILL_NUMERATOR_DENOMINATOR Fill in missing values considering relationship between two variables

FF_summary()

FF_summary summarize a loaded FAO dataset

FF_join_checkmap()

FF_join_checkmap: full-join data frames by a common COL_by variable to checking mapping

FF_check_count_plot()

FF_check_count_plot: count item_code and area_code by year

rm_accent()

rm_accent: Remove accent and prime in selected columns of a data frame

GROSS_TRADE_ADJUST()

Balance gross trade

SUA_bal_adjust()

Balance Supply Utilization Accounting data

assert_FBS_balance()

assert processed food balance sheet or supply utilization account is balanced

output_csv_data()

Function saving dataset to csv file with headers

Moving_average()

Moving average

downscale_FAO_country()

downscale_FAO_country

treemap_wrapper()

treemap_wrapper: a warpper function of the treemap function

Prebuilt data

GCAM_DATA_MAP

GCAM_DATA_MAP

PREBUILT_DATA

A list of prebuilt data objects. FAOSTAT raw data, those generated in modules xfaostat_L101_RawDataPreProc*, are included to facilitate the processing. Its immediate downstream dependencies then used the prebuilt versions of their outputs stored in this object.

extract_prebuilt_data()

extract_prebuilt_data

verify_identical_prebuilt()

verify_identical_prebuilt

gcamdata internal functions (data processing)

approx_fun()

approx_fun

approx_fun_constant()

approx_fun_constant

fast_left_join()

Fast left join for large tables

gather_years()

Helper function: call tidyr::gather for year-like columns and convert them to integers

gdp_deflator()

Calculate a gross domestic product (GDP) implicit price deflator between two years.

graph_chunks()

graph_chunks

left_join_error_no_match()

left_join_error_no_match

left_join_keep_first_only()

Compute a left join, taking only the first match.

repeat_add_columns()

repeat_add_columns

standardize_iso()

Standardize the ISO column by converting to lower case and renaming to 'iso'

change_iso_code()

Change a particular ISO code in a table to another code.

gcamdata internal functions (data tracing)

add_column_types_header_line()

add_column_types_header_line

add_data()

add_data

add_comments()

add_comments

add_flags()

add_flags

add_legacy_name()

add_legacy_name

add_precursors()

add_precursors

add_reference()

add_reference

add_title()

add_title

add_units()

add_units

same_attributes_as()

same_attributes_as

same_precursors_as()

same_precursors_as

get_comments()

get_comments

get_data()

getdata

get_data_list()

get_data_list

get_flags()

get_flags

get_relative_to_workdir()

Normalize file path to the working directory

return_data()

return_data

save_chunkdata()

Write data produced by chunks to csv files.

dstrace_chunks()

A simplified dstrace which simply finds the chunks which are precursors recursively.

dstrace_plot()

Plot a trace

check_chunk_outputs()

check_chunk_outputs

chunk_inputs()

chunk_inputs

chunk_outputs()

chunk_outputs

chunk_readylist()

chunk_readylist

empty_data()

empty_data

extract_header_info()

extract_header_info

find_chunks()

find_chunks

find_csv_file()

find_csv_file

find_header()

find_header

is_data_list()

is_data_list

load_csv_files()

load_csv_files

missing_data()

missing_data

normalize_files()

normalize_files

parse_csv_header()

parse_csv_header

remove_data()

remove_data

run_chunk()

run_chunk

screen_forbidden()

screen_forbidden

tibbelize_outputs()

tibbelize_outputs

warn_data_injects()

warn_data_injects

warn_datachunk_bypass()

warn_datachunk_bypass

warn_mismarked_fileinputs()

warn_mismarked_fileinputs

protect_integer_cols() unprotect_integer_cols()

Protect column names that are bare integers from being interpreted as integers