addData_raw: addData_raw

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/addData_raw.R

Description

Function to add validation data to the library.

Usage

1
addData_raw(data,aggr_type,aggr_args=NULL,collection,name,historical=TRUE,unit=NULL,citation=NULL,comment=NULL,overwrite=FALSE,internal=FALSE,svn_path=NULL)

Arguments

data

A magpie object containing the data. If uncertainty information is available, one dimension with the following dimnames has to exist:

  • data The column 'data' contains the data values

  • up (optional) upper limit of the error bars

  • lo (optional) lower limit of the error bars

It is only possible to specify both, 'up' and 'lo' or neither of the two.

aggr_type

A string specifying the aggregation type to be used for the dataset. You can see available aggregation types using show_aggrTypes. New aggregation types can be added using add_aggrType.

aggr_args

Sometimes aggr_type will require additional arguments such as weights. They are specified here as a list.

collection

A string specifying the name of the collection in the library that this dataset corresponds to. Must not contain blank spaces.

name

A string specifying the name of the data source. Must not contain blank spaces.

historical

Flag indicating if the added data is historical (TRUE) or based on other model projections (FALSE)

unit

The unit of the dataset in the format c(10^6,"tC/a")

citation

The citation for the dataset, preferably in bibtex format.

comment

A free text comment. This should contain information about data source and quality.

overwrite

Boolean. By default (FALSE) an error is issued if a dataset named 'name' already exists for the collection 'collection'. If you want to overwrite this a dataset, you have to set this flag to TRUE.

internal

Boolean. By default (FALSE) the library is checked out, updated and committed. If TRUE, only the valdata object in the workspace is modified.

svn_path

Path of the svn repository. If NULL, standard paths will be tested.

Details

The function tries to add the desired dataset to the validation library. Additionally, the aggregation routine for data is specified. Each dataset in the library can only have one common aggregation type. Each aggregation level shares one set of aggr_args, so that all entries are aggregated exactly the same way.

Value

No value is returned. Instead the data is saved in the valdata object of the library and the library is updated and committed if internal=FALSE.

Author(s)

Markus Bonsch

See Also

validationPlot,getData,add_aggrType,show_aggrTypes,addMapping

Examples

1
## Not run: addData_raw(data=cropland_object,aggr_type="sum",collection="cropland_physical",name="FAO",historical=TRUE,comment=c("FAO historical cropland","source:www.fao.org","data_quality: good"))

pik-piam/validation documentation built on Nov. 5, 2019, 12:50 a.m.