[R] scaling-centering a vector using an index

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Wed Sep 4 19:57:09 CEST 2002


Thomas de Cornulier <oedic at cebc.cnrs.fr> writes:

> dear all,
> I would like to center and scale some columns of a data frame (these
> include NAs) according to the levels of an index (list of factors from
> the same data frame).
> I tried to code it using for loops but gave up. I guess there is a
> straightforward way to achieve this: any hint welcome!
> thanks a lot
> thomas

Erm, define "according to the levels of" or have a look at the
examples for split/unsplit and see whether you mean what I think you
mean....

-- 
   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 mailing list