SetNames(1:5, names=letters[1:5])
# the default, if no argument names are provided, is "names"
SetNames(1:5, letters[1:5])
tab <- table(d.pizza$driver, d.pizza$wine_delivered)
# rownames and columnnames can be set at the same time
SetNames(BinomCI(tab[,1], rowSums(tab)),
rownames=rownames(tab), colnames=c("perc", "lci", "uci"))
# can also be used to set the names to an empty string
SetNames(diag(6), rownames="", colnames="")
# setting dimnames works as well
tab <- SetNames(
as.table(rbind(c(84,43), c(10,92))),
dimnames= list(
dipstick=c("positive","negative"),
culture=c("positive","negative")))
Run the code above in your browser using DataLab