[R] Re: R-help Digest, Vol 28, Issue 6

From: Sebastian Schoenherr <csad4933_at_uibk.ac.at>
Date: Mon 06 Jun 2005 - 23:34:16 EST

Dear all,
i have a question as regards to the read.table /table command:

I read in the following file:
Method1 23
Method2 12
Method3 43
Method4 76
Method1 2
Method3 4

If i use the "table" command I get the following matrix:

         V2
V1         2 4 12 23 43 76

  Method1 1 0 0 1 0 0
  Method2 0 0 1 0 0 0
  Method3 0 1 0 0 1 0
  Method4 0 0 0 0 0 1

Is it possible that R groups my values, to get an matrix which looks nearly like this:
V1
  Method1 23 2
  Method2 12 0
  Method3 43 4
  Method4 76 0

Some ideas?

Thanks in advance

Cheers
Sebastian



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Mon Jun 06 23:53:53 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:23 EST