sorting - How to preserve the order of a vector in a table in R? -


pretty simple question, assume. trying different type of object (with class 'acf' , type 'list'), assume answer extendable vector (class numeric, type 'double'):

 x<-c(4, 5, 6, 1, 2, 10, 15)  table(x)  x  1  2  4  5  6 10 15   1  1  1  1  1  1  1  

i output of table in same order vector (4, 5, 6, 1, 2, 10, 15). how can achieve this?

 table(factor(x, levels=unique(x))) 

Comments

Popular posts from this blog

Python Kivy ListView: How to delete selected ListItemButton? -

asp.net mvc 4 - A specified Include path is not valid. The EntityType '' does not declare a navigation property with the name '' -