list2m | R Documentation |
The function returns the multiset representation of a vector or a list, in increasing order.
list2m( v=c(0) )
v |
single vector or list of vectors |
Given a list in input, the list2m
function returns a structure as
[[e1,e2,...], m1], [[f1,f2,...], m2],...
where m1, m2,...
are the instances
of c(e1,e2,...), c(f1,f2,...), ...
in the input vector v
.
multiset |
the list of multisets |
Called by the countP
function in the kStatistics
package.
Elvira Di Nardo elvira.dinardo@unito.it,
Giuseppe Guarino giuseppe.guarino@rete.basilicata.it
D.E. Knuth (1998) The Art of Computer Programming. (3rd ed.) Addison Wesley.
list2Set
,
m2Set
,
countP
# Return the list of multisets [[1],3], [[2],1] from the input vector (1,2,1,1) list2m(c(1,2,1,1 )) # Return the list of multisets [[1,2],2], [[2,3],1] from the input list (c(1,2),c(2,3),c(1,2)) list2m(list(c(1,2),c(2,3),c(1,2)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.