R/rstacknode.R

Defines functions rstacknode

Documented in rstacknode

#' @export
#' @title Internal structure used by rstacks, rdeques, and rpqueues
#' @description
#' For use by rstacks and rdeques. Simply an environment with no parent,
#' reference for the data and the next node.
#' @param data data to reference with this node.
#' @return an environment.
#' 
rstacknode <- function(data) {
  newnode <- new.env(parent = emptyenv())
  newnode$data <- data
  newnode$nextnode <- NULL
  class(newnode) <- "rstacknode"
  return(newnode)
}

Try the rstackdeque package in your browser

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

rstackdeque documentation built on May 2, 2019, 4:15 a.m.