[R] How to construct a double-entry with variables from a dataset

ruipbarradas at sapo.pt ruipbarradas at sapo.pt
Fri Sep 23 17:26:31 CEST 2016


Is this what you mean?

dat <- data.frame(x = rnorm(100), A = factor(sample(3, 100, TRUE)), B  
= factor(sample(3, 100, TRUE)))
xtabs(~ A + B, dat)

Hope this helps,

Rui Barradas

Citando Andrea Marcela Huerfano Barbosa <anmhuerfanoba at unal.edu.co>:

> Hi everyone,
> My name is Marcela, I am bachelor student of statistics.
> I have a data frame with 59 variables and two of them are categorical  and
>  have three levels each one,  I would like to construct a double -entry
> table with this variables, I mean the categorical ones.
> Any help will be really thankful
> Thanks for reading
> Andrea Marcela
> --
> 	[[alternative HTML version deleted]]
> ______________________________________________
> R-help at 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