read.mtg {dad}R Documentation

Read a MTG (Multiscale Tree Graph) file

Description

Reads an MTG (Multiscale Tree Graph) file and returns an object of class foldermtg, that is a list of data frames (see Details).

Usage

read.mtg(file, ...)

Arguments

file

character. Path of the MTG file.

...

optional arguments to print methods.

Details

Recalling that a MTG file is a text file that can be opened with a spreadsheet (Excel, LibreOffice-Calc...). Its 4 tables are:

See the example below.

Value

read.mtg returns an object, say x, of class fodermtg, that is a list of at least 6 data frames:

classes

the table CLASSES: in the MTG file.

description

the table DESCRIPTION: in the MTG file.

features

the table FEATURES: in the MTG file.

topology

data frame containing the first columns of the "MTG:" table of the MTG file. If the maximum branching order of the elements of the MTG is p, then x$topology has p columns.

If the i-th vertex appears on the j-th column, it means that its branching order is j, that is it belongs to a vertex of the j-th order.

coordinates

data frame of the spatial coordinates of the entities. It has six columns: XX, YY, ZZ (cartesian coordinates), AA, BB, CC (angle coordinates). If there are no coordinates in the MTG file, this data frame has 0 row.

The sixth and following elements are nclass data frames, nclass being the number of classes in the MTG file. Each data frame matches with a vertex class, such as "P" (plant), "A" (axes), "M" (metamers or phytomers), and contains the features on the corresponing vertices.

Author(s)

Rachid Boumaza, Pierre Santagostini, Smail Yousfi, Gilles Hunault, Sabine Demotes-Mainard

References

Pradal, C., Godin, C. and Cokelaer, T. (2023). MTG user guide

See Also

print.foldermtg

mtgorder

Examples

mtgfile1 <- system.file("extdata/plant1.mtg", package = "dad")
x1 <- read.mtg(mtgfile1)
print(x1)

mtgfile2 <- system.file("extdata/plant2.mtg", package = "dad")
x2 <- read.mtg(mtgfile2)
print(x2)

[Package dad version 4.1.2 Index]