| SetNames {DescTools} | R Documentation |
This is a convenience function that sets the names on an object and returns the object. It is most useful at the end of a function definition where one is creating the object to be returned and would prefer not to store it under a name just so the names can be assigned. In addition to the function setNames the user can decide, whether rownames, colnames or simply the names are to be set.
SetNames(x, ...)
x |
an object for which a names attribute will be meaningful |
... |
the names to be assigned to the object. This should be a character vector of names named |
An object of the same sort as object with the new names assigned.
Andri Signorell <andri@signorell.net>
tab <- table(d.pizza$driver, d.pizza$wine_delivered) SetNames(BinomCI(tab[,1], rowSums(tab)), rownames=rownames(tab))