R/is.node.R

Defines functions is.node

Documented in is.node

#' @title 
#' Test if an object is a node
#' 
#' @description 
#' The function \code{is.node} returns \code{TRUE} 
#' if \code{x} is a node, \code{FALSE} otherwise. 
#' A 'node' is just an \code{rtree} object with no subtrees. 
#' 
#' @param x
#' An object to be tested. 
#' 
#' @return 
#' A logical. 
#' 
#' @export
#' 
is.node <- 
function(x)
{
  is.rtree(x) && 
    #inherits(x, "node") && 
    length(subtrees(x))==0L
}

Try the oak package in your browser

Any scripts or data that you put into this service are public.

oak documentation built on May 1, 2019, 9:13 p.m.