File: getLabel.R

package info (click to toggle)
r-cran-distr 2.9.7%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 2,344 kB
  • sloc: ansic: 199; sh: 13; makefile: 2
file content (19 lines) | stat: -rw-r--r-- 631 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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=""))
  }
}