One-Dimensional Table of Frequences and/or Percentages
## S4 method for signature 'atomic' Table(x,weights=NULL,counts=TRUE,percentage=FALSE,...) ## S4 method for signature 'factor' Table(x,weights=NULL,counts=TRUE,percentage=FALSE,...) ## S4 method for signature 'item.vector' Table(x,weights=NULL,counts=TRUE,percentage=(style=="codebook"), style=c("table","codebook","nolabels"), include.missings=(style=="codebook"), missing.marker=if(style=="codebook") "M" else "*",...)
x |
an atomic vector, factor or |
counts |
logical value, should the table contain counts? |
percentage |
logical value, should the table contain percentages?
Either the |
style |
character string, the style of the names or rownames of the table. |
weights |
a numeric vector of weights of the same length as |
include.missings |
a logical value; should missing values included into the table? |
missing.marker |
a character string, used to mark missing values in the table (row)names. |
... |
other, currently ignored arguments. |
The atomic vector and factor methods return either a vector
of counts or vector of percentages or a matrix of counts and percentages.
The same applies to the "item.vector"
vector method unless
include.missing=TRUE
and percentage=TRUE
,
in which case total percentages and percentages of valid values
are given.
with(as.data.frame(UCBAdmissions),Table(Admit,Freq)) Aggregate(Table(Admit,Freq)~.,data=UCBAdmissions) A <- sample(c(1:5,9),size=100,replace=TRUE) labels(A) <- c(a=1,b=2,c=3,d=4,e=5,dk=9) missing.values(A) <- 9 Table(A,percentage=TRUE)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.