R/getLabel.R

getLabel <- function (x, withnames = TRUE)
{
    cl <- as.character(class(x)[1])
    slots <-  slotNames(param(x))
    slots <-  slots[slots != "name"]
    qparamstring <-""
    nrvalues <-  length(slots)
    if(nrvalues > 0){
          values <-  numeric(nrvalues)
      for(i in 1:nrvalues)
        values[i] <-  attributes(attributes(x)$param)[[slots[i]]]
    if( withnames)
        nparamstring <-  paste(slots, "=", values, collapse = ", ")
   else
        nparamstring <-  paste(values, collapse = ", ")
    qparamstring <- paste("(",nparamstring,")",sep="")
  return(paste(cl,qparamstring,sep=""))
  }
} 

Try the distr package in your browser

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

distr documentation built on Jan. 29, 2024, 3 a.m.