Hi,

 

Let s be a dataframe. 

 

> s

   A B C

   0 0 1

   1 0 1

   1 0 1

   0 0 1

   1 0 1

   0 1 1

   0 1 1

   0 1 1

   0 0 1

 

> tab1=table(s[,c(1,2)])

> tab1

   B

A   0 1

  0 3 3

  1 3 0

 

> tab2=table(s[,c(1,3)])

> tab2

   C

A   1

  0 6

  1 3

 

 

The problem is I need to access frequency corresponding to (0,0).
tab1[1] will give me the correct value while tab2[1] will not give the
frequency which I expected. So, is there a possibility in the table
command to have the order of tab1 and tab2 being equal? (here 2*2). May
be by filling in the appropriate value as 0 or NA?

 

Thanks,

Shubha

 

This e-mail may contain confidential and/or privileged i...{{dropped:13}}

______________________________________________
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