R/defaults.r

Defines functions defaults

Documented in defaults

#' Set defaults.
#'
#' Convient method for combining a list of values with their defaults.
#'
#' @param x list of values
#' @param y defaults
#' @keywords manip
#' @export
defaults <- function(x, y)  {
  c(x, y[setdiff(names(y), names(x))])
}

Try the plyr package in your browser

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

plyr documentation built on Oct. 2, 2023, 9:07 a.m.