R/getDefaultMappings.R

Defines functions getDefaultScalings getDefaultMappings

Documented in getDefaultMappings getDefaultScalings

##' Get the default mappings and scalings for a given sonlayer shape
##'
##' Given a \code{shape} name, these functions returns the default
##' mappings or scalings for that shape.
##'
##' @rdname getDefaultMappings
##' @param shape A character containing the name of the shape to be
##' looked up
##' @return The default mappings or default scalings for a given
##' shape.
##' @export
##' @keywords internal
getDefaultMappings <- function(shape) {
  shapedef <- getShapeDef(shape)
  defaults <- lapply(shapedef$params, function(x) x$defaultSetting)
  return(do.call(sonaes, defaults))
}

##' @rdname getDefaultMappings
##' @export
getDefaultScalings <- function(shape) {
  shapedef <- getShapeDef(shape)
  defaults <- lapply(shapedef$params, function(x) x$defaultScaling)
  return(do.call(sonscaling, defaults))
}
                     

Try the playitbyr package in your browser

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

playitbyr documentation built on May 31, 2017, 4:30 a.m.