read.magpie | R Documentation |
Reads a MAgPIE-file and converts it to a 3D array of the structure (cells,years,datacolumn)
read.magpie(
file_name,
file_folder = "",
file_type = NULL,
as.array = FALSE,
comment.char = "*",
check.names = FALSE,
...
)
file_name |
file name including file ending (wildcards are supported). Optionally also the full path can be specified here (instead of splitting it to file_name and file_folder) |
file_folder |
folder the file is located in (alternatively you can also specify the full path in file_name - wildcards are supported) |
file_type |
format the data is stored in. If file_type=NULL the file ending
of the file_name is used as format. If format is different to the formats
mentioned standard MAgPIE format is assumed. See |
as.array |
Should the input be transformed to an array? This can be useful for regional or global inputs, but all advantages of the magpie-class are lost. |
comment.char |
character: a character vector of length one containing a single character or an empty string. Use "" to turn off the interpretation of comments altogether. If a comment is found it will be stored in attr(,"comment"). In text files the comment has to be at the beginning of the file in order to be recognized by read.magpie. |
check.names |
logical. If TRUE then the names of the variables in the data frame are checked to ensure that they are syntactically valid variable names. Same functionality as in read.table. |
... |
additional arguments passed to specific read functions (e.g.
|
See write.magpie
for a list of supported file formats.
x |
MAgPIE-object |
See write.magpie
for the detailed structure of binary MAgPIE formats .m and .mz.
Jan Philipp Dietrich, Stephen Bi, Florian Humpenoeder, Pascal Sauer
"magpie"
, write.magpie
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.