length {base} | R Documentation |
If x
is a vector or list length
returns the length of x
.
Otherwise, length
returns NA
.
The second form above can be used to reset
the length of a vector.
If a vector is shortened, extra values are discarded
and when a vector is lengthened, it is padded out to
its new length with NA
s.
length(x)
length(x) <- n