R/length.R

#  ---------------------------------------------------------------------
# length.R
#   return the number of keys in a hash
#   NB:
#     - This doesn't work: env.profile(x@.Data)$nchains
#  ---------------------------------------------------------------------

#' length Returns the number of key-value pairs in a hash
#' 
#' Returns the number of items in a hash
#' 
#' Return the number of items in the hash by calling [length()] on
#' the internal environment.
#' 
#' @aliases length 
#' @return integer Number of items in the hash.
#' @author Christpher Brown
#' @seealso See Also [hash()], [length()]
#' @keywords methods
#' @examples
#' 
#' 
#'   h <- hash( letters, 1:26 )
#'   length(h) # 26
#' 
#' @rdname hash

setMethod( "length", "hash", function(x) length( x@.Data ) )
decisionpatterns/r-hash documentation built on Feb. 6, 2019, 10:27 p.m.