On Sun, 7 Oct 2007, Öhagen Patrik wrote:




Dear All,

I would like to have some controll over the output from the function table(). I want to controll the order of the cells and I want to include empty cells (if any).

Example: I have ordinal data wich takes the values 1,2,3....N but I want the output from table to put the frequencies in a different order, say, 3,7,1,4.... and I want to include categories with zero frequency.

How is that done?

See ?tabulate. You can reorder the result via indexing: I don't follow what you want and you did not give us an example. (For example, is 'ordinal data' represented by an ordered factor or by an integer vector?)

--
Brian D. Ripley,                  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to