labels(object, ...) ## Default S3 method: labels(object, ...) ## S3 method for class 'dendrogram': labels(object, ...) ## S3 method for class 'dist': labels(object, ...) ## S3 method for class 'lm': labels(object, ...) ## S3 method for class 'glm': labels(object, ...) ## S3 method for class 'terms': labels(object, ...)
| object | an object of fitted model, for which a printing or plotting method, or similar function, is to be called. | 
| ... | additional arguments to be passed to or from future functions. | 
x <- c(a=11, b=22, c=33)
cat("Results were:\n", paste(labels(x), "=", x), "\n")
## Results were:
##  a = 11 b = 22 c = 33
d <- data.frame(Big=factor((1:20) > 12), Small=factor((1:20) < 8), Y=1:20)
labels(d)
## [[1]]
##  [1] "1"  "2"  "3"  "4"  "5"  "6"  "7"  "8"  "9"  "10" "11" "12" "13" "14" "15"
## [16] "16" "17" "18" "19" "20"
## 
## [[2]]
## [1] "Big"   "Small" "Y"
labels(terms(Y ~ Big * Small))  # names of expanded terms
## [1] "Big"       "Small"     "Big:Small"
labels(lm(Y ~ Big * Small, data=d))  # omits interaction term: coef was NA
## [1] "Big"   "Small"
ff.dist <- dist(Sdatasets::fuel.frame[,1:4])
labels(ff.dist)  # same as rownames of input to dist()
##  [1] "Eagle Summit 4"                "Ford Escort 4"                
##  [3] "Ford Festiva 4"                "Honda Civic 4"                
##  [5] "Mazda Protege 4"               "Mercury Tracer 4"
##     .
##     .
##     .
## [59] "Nissan Axxess 4"               "Nissan Van 4"
labels(c(1.1, 1.4, 2.0))  # creates labels c("1", "2", "3")