R/getShapeDef.R

##' Get the \code{shapeDef} object for a shape
##'
##' Each shape has a \code{shapeDef} object associated with it,
##' which is  a list specifying many aspects of the shape and its
##' default; this function takes a sonlayer object or a character
##' string and gets the appropriate shapeDef.
##'
##' @rdname getShapeDef
##' @param x A \code{\link{sonlayer}} object or character string
##' @return \code{getShapeDef} returns a \code{shapeDef} object;
##' \code{getShapeNames} returns a character vector containing the
##' names of all currently available shapes
##' @export
##' @keywords internal
getShapeDef <- function(x) {
  if(is.character(x))
    shape <- x
  else shape <- class(x)
  
  return(allShapeDefs[[shape]])
}

##' @rdname getShapeDef
##' @export
getShapeNames <- function() names(allShapeDefs)
  

Try the playitbyr package in your browser

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

playitbyr documentation built on May 2, 2019, 6:08 p.m.