structure {base} | R Documentation |
structure
returns the given object with further
attributes set.
structure(.Data, ...)
.Data |
an object which will have various attributes attached to it. |
... |
attributes, specified in tag=value
form, which will be attached to data. |
Adding a tsp
attribute will ensure that the object
returned inherits from class "ts"
, and adding a
levels
attribute ensures that the returned object is a
factor. These conversions are deprecated: they give a warning and
will be removed in R 2.5.0.
For historical reasons (these names are used when deparsing),
attributes ".Dim"
, ".Dimnames"
,
".Names"
, ".Tsp"
and ".Label"
are renammed to
"dim"
, "dimnames"
, "names"
, "tsp"
and
"levels"
.
It is possible to give the same tag more than once, in which case the
last value assigned wins. As with other ways of assigning attributes,
using tag=NULL
removes attribute tag
from .Data
if
it is present.
Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) The New S Language. Wadsworth & Brooks/Cole.
structure(1:6, dim = 2:3)