magclass (version 4.107.0)

write.reportProject: Write file in specific project format

Description

Reads in a reporting.mif or uses a magpie object based on a read in reporting.mif, substitutes names of variables according to the mappping, mutliplies by an optional factor in a column named "factor" of the mapping, and saves the output in a new *.mif

Usage

write.reportProject(mif, mapping, file = NULL, max_file_size = NULL,
  format = "default", ...)

Arguments

mif

Lists with magpie-objects or a magpie-object as created by read.report or a path to a report.mif

mapping

mapping of the variable names of the read in mif. the header is used for naming. The format of the mapping should be: 1st column the standard naming in PIK mif format. X further columns that contain the indicator names in the reporting format. Can also contain several indicator columns (e.g Variable and Item). Optional columns with reserved names are unit, weight, and factor. Factor is a number that the results will be multplied with (e.g. to transform CO2 into C) Weight is needed if several mif indicators shall be aggregated to one reporting indicator. You always need a weight column if you have multiple mif to one reporting mappings. If you have a weight column, you have to have values in it for all indicators. If NULL, the results are added up; if you provide an indicator name (of a mif indicator), this indicator will be used for the weighting of a weighted mean. Unit is a name of the unit without () Example: "mif";"agmip";"Item";"unit";"weight";"factor" "Nutrition|+|Calorie Supply (kcal/capita/day)";"CALO";"AGR";"kcal/capita/day";"NULL";1

file

name of the project specipic report, default=NULL means that the names of the header of the reporting is used

max_file_size

maximum file size in MB; if size of file exceeds max_file_size reporting is split into multiple files

format

available reporting formats: "default", "IAMC" and "AgMIP". "default" and "IAMC" are very similar (wide format for year) and differ only in the use of semi-colon (default) and comma (IAMC) as seperator. "AgMIP" is in long format.

...

arguments passed to write.report and write.report2

See Also

write.report

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
write.reportProject("REMIND_generic_test.mif","Mapping_generic_ADVANCE.csv")
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab