[R] R WRONG CALCULATIONS - Please Help

Rui Barradas
Mon, 14 Sep 2015 17:04:23 -0000

Hello,

R subtracts the _column_ vector 'mean' to X (column by column).
Apparently you want the transpose, or think 'mean' is a row vector. Try
instead

t(t(X) - mean)

And use another name for 'mean', it already is the name of a function.

Hope it helps,

Rui Barradas

Em 14-09-2015 16:11, JORGE COLACO escreveu:
> I would greatly appreciate if you could let me know why the R does not make
> the right computations in the case below.
> Waiting for your reply
> Jorge Cola?o
>
>
>
>
>
>
> R version 3.2.2 (2015-08-14) -- "Fire Safety"
> Copyright (C) 2015 The R Foundation for Statistical Computing
> Platform: i386-w64-mingw32/i386 (32-bit)
>
> R is free software and comes with ABSOLUTELY NO WARRANTY.
> You are welcome to redistribute it under certain conditions.
> Type 'license()' or 'licence()' for distribution details.
>
> R is a collaborative project with many contributors.
> Type 'contributors()' for more information and
> 'citation()' on how to cite R or R packages in publications.