Peter Dalgaard BSA
p.dalgaard at biostat.ku.dk
Tue Sep 26 19:31:32 CEST 2000
Phil Rhoades <philr at mail.austasia.net> writes:
> Hi all,
> I want to replace a couple of (Excel) steps in processing the output of
> some biological simulations - it should be easy for you guys so I was
> hoping for a quickstart from someone . .
> I want to read values from a text file - 200 lines, 32 floats per line -
> and calculate a mean for each of the 32 values, so I would end up with an
> "x" vector of 1-200 and a "y" vector of the 200 means.
y <- apply(as.matrix(read.table("myfile")), 1, mean)
x <- seq(along=y)
(possibly adding a couple of options to read.table, depending on the
O__ ---- Peter Dalgaard Blegdamsvej 3
c/ /'_ --- Dept. of Biostatistics 2200 Cph. N
(*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
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