Why ask if you already know the answer. Did you try table()?

Other commands related: reshape {stats} and xtabs {stats}

I learned about this only a couple of days ago on this list!

Meanwhile read the posting guide and send your requests in English.

Good luck,

Sander.


Hansi Weissensteiner wrote:
Hallo!

Ich habe ein Textdokument das folgenden Aufbau aufweisst:

String Integer z.B.
AAA    10
BBB    15
CCC    12
BBB    13
AAA    11
DDD    14

Mein Ziel ist es, die Daten in eine Matrix zu schreiben, ohne dabei mit
Schleifen zu arbeiten. Ist dies möglich? Die entsprechende Matrix sollte dann
wie folgt aufgebaut sein:

AAA BBB CCC DDD
 10  15  12  14
 11  13   0   0

Ich denke an den Befehl table(), oder gibt es sonstige Befehle?

Danke im Vorraus
MfG
Hansi Weissensteiner

______________________________________________
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



--
--------------------------------------------
Dr Sander P. Oom
Animal, Plant and Environmental Sciences,
University of the Witwatersrand
Private Bag 3, Wits 2050, South Africa
Tel (work)      +27 (0)11 717 64 04
Tel (home)      +27 (0)18 297 44 51
Fax             +27 (0)18 299 24 64
Email   [EMAIL PROTECTED]
Web     www.oomvanlieshout.net/sander

______________________________________________
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

Reply via email to