?scale or ?sweep or ?lapply
--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at intermountainmail.org
(801) 408-8111
> -----Original Message-----
> From: r-help-bounces at r-project.org
> [mailto:r-help-bounces at r-project.org] On Behalf Of Mark Deacon
> Sent: Friday, November 09, 2007 6:47 AM
> To: r-help at stat.math.ethz.ch
> Subject: [R] Recycling Rule
>
> Hi, I have an efficiency question.
>
> To centralise a dataset (in a data frame) I have been using:
>
> a <- mean(Data)
> Data <- t(t(Data)-a)
>
> ...to force row-wise recycling.
>
> Is there a better/more efficient/more elegant way than
> transposing the dataset twice?
>
> Thanks
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>