[R] Attribute Combinations

Ista Zahn |@t@z@hn @end|ng |rom gm@||@com
Thu May 21 19:56:22 CEST 2020


Another one just for fun:

prop.table(table(interaction(x)))

or possibly

prop.table(table(droplevels(interaction(x))))

Best,
Ista


On Thu, May 21, 2020 at 1:22 PM Jeff Reichman <reichmanj using sbcglobal.net> wrote:
>
> R-help forum
>
>
>
> Looking for a function or some guidance for obtaining the percentage of
> attribute combinations, for example
>
>
>
> V1           V2           V3
>
> A             A             B
>
> A             B             C
>
> A             A             D
>
> A             A             B
>
> A             A             B
>
> A             B             C
>
> A             C             B
>
> A             C             B
>
> A             B             C
>
> A             C             C
>
>
>
> Results
>
> A,A,B     0.30
>
> A,B,C     0.30
>
> A,A,D    0.10
>
> A,C,B     0.20 etc
>
>
>
> Sincerely
>
>
>
> Jeff Reichman
>
> (314) 457-1966
>
>
>
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.



More information about the R-help mailing list