- if (length(node) > 1) {
- node <- node[1]
- warning("only the first value of 'node' has been considered")
- }
- if (is.character(node)) {
- if (is.null(phy$node.label))
- stop("the tree has no node labels")
- node <- which(phy$node.label %in% node) + Ntip
+ if (interactive) node <- identify(phy)$nodes else {
+ if (length(node) > 1) {
+ node <- node[1]
+ warning("only the first value of 'node' has been considered")
+ }
+ if (is.character(node)) {
+ if (is.null(phy$node.label))
+ stop("the tree has no node labels")
+ node <- which(phy$node.label %in% node) + Ntip
+ }
+ if (node <= Ntip)
+ stop("node number must be greater than the number of tips")