[R] KS test and data format

Arne Mueller a.mueller at cancer.org.uk
Sun Jun 23 00:58:27 CEST 2002


Dear All,

I've a problem with the data format and the ks.test() function
(Kolmogorov-Smirnov). The test function expects two numeric vectors, but
the two data distributions I'd like to test are actually in the
following format:

2  4
3  6
5  6
7  2
...

where the 1st column is a data position and the 2nd is the frequency
this data point is observed. To generate an appropiate vector I've to
turn the frequencies into the actual numbers, like:

2
2
2
2
3
3
3
3
3
3
...

I could write a C program for this, but I was wondering whether there is
a quick way in R to do this data transformation.

	thanks alot for help,

	Arne

-- 
Arne Mueller
Biomolecular Modelling Laboratory
Cancer Research UK, London Research Institute
44 Lincoln's Inn Fields
London WC2A 3PX, U.K.
phone1 : +44-(0)20-72693405      | fax  : +44-(0)20-75945789
phone2 : +44-(0)20-75945776      | mobil: +44-(0)7984601749
email  : a.mueller at cancer.org.uk | http://www.bmm.icnet.uk
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list