formatData(phy, dt, type = c("tip", "internal", "all"), match.data = TRUE, rownamesAsLabels = FALSE, label.type = c("rownames", "column"), label.column = 1, missing.data = c("fail", "warn", "OK"), extra.data = c("warn", "OK", "fail"), keep.all = TRUE)
phylo4
objectrownames
or column
:
should the labels be taken from the row names of dt
or from
the label.column
column of dt
?label.type=="column"
, column
specifier (number or name) of the column containing tip labelsformatData
returns a data frame having node numbers
as row names. The data frame is also formatted to have the correct
dimension given the phylo4
object provided.
formatData
is an internal function that should not be
called directly by the user. It is used to format data provided by
the user before associating it with a tree, and is called
internally by the phylo4d
, tdata
, and addData
methods. However, users may pass additional arguments to these
methods in order to control how the data are matched to nodes.Rules for matching rows of data to tree nodes are determined
jointly by the match.data
and rownamesAsLabels
arguments. If match.data
is TRUE, data frame rows will be
matched exclusively against tip and node labels if
rownamesAsLabels
is also TRUE, whereas any all-digit row
names will be matched against tip and node numbers if
rownamesAsLabels
is FALSE (the default). If
match.data
is FALSE, rownamesAsLabels
has no effect,
and row matching is purely positional with respect to the order
returned by nodeId(phy, type)
.
formatData
(1) converts labels provided in the data into
node numbers, (2) makes sure that the data are appropriately
matched against tip and/or internal nodes, (3) checks for
differences between data and tree, (4) creates a data frame with
the correct dimensions given a tree.
phylo4d-methods
constructor, the
phylo4d class. See coerce-methods
for
translation functions.