Mendapatkan atau mengatur atribut tertentu dari suatu objek.
attr(x, which, exact = FALSE)
attr(x, which) <- value
| Parameter | Deskripsi |
|---|---|
x |
an object whose attributes are to be accessed. |
which |
a non-empty character string specifying which attribute is to be accessed. |
exact |
logical: should which be matched exactly? |
value |
an object, the new value of the attribute, or NULL to remove the attribute. |
# NOT RUN {
# create a 2 by 5 matrix
x <- 1:10
attr(x,"dim") <- c(2, 5)
# }