Dear all,
I have a file with 57 columns (671 time points in each column)
File looks like this:
10.279191 -1.203200e-02 -0.166772 6.12080e-02 0.196379
4.591900e-02 0.293689
20.267017 -1.150700e-02 -0.159463 5.85400e-02 0.187775
4.392200e-02 0.280854
30.053778
What kind of normalization do you want to do?
If you want to divide all columns by the median absolute value, try :
apply(some_dataset,2,function(x){
x-median(abs(x))
})
also look at ?scale for normalization using the average and the sd.
Cheers
Joris
On Tue, May 25, 2010 at 6:01 PM,
My code substracts the median absolute value. If you want to divide by it,
the code must be :
apply(some_dataset,2,function(
x){
x/median(abs(x))
})
Thanks to Peter Langfelder for pointing out my mistake.
On Tue, May 25, 2010 at 6:24 PM, Joris Meys jorism...@gmail.com wrote:
What kind
-help@r-project.org
Subject: Re: [R] File normalization
My code substracts the median absolute value. If you want to divide by it,
the code must be :
apply(some_dataset,2,function(
x){
x/median(abs(x))
})
Thanks to Peter Langfelder for pointing out my mistake.
On Tue, May 25, 2010 at 6:24 PM
25, 2010 9:54 AM
To: cobbler_squad
Cc: r-help@r-project.org
Subject: Re: [R] File normalization
My code substracts the median absolute value. If you want to divide by it,
the code must be :
apply(some_dataset,2,function(
x){
x/median(abs(x))
})
Thanks to Peter Langfelder
Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
On
Behalf Of Joris Meys
Sent: Tuesday, May 25, 2010 9:54 AM
To: cobbler_squad
Cc: r-help@r-project.org
Subject: Re: [R] File normalization
My code substracts the median absolute value. If you want to divide
-project.org]
On
Behalf Of Joris Meys
Sent: Tuesday, May 25, 2010 9:54 AM
To: cobbler_squad
Cc: r-help@r-project.org
Subject: Re: [R] File normalization
My code substracts the median absolute value. If you want to divide by
it,
the code must be :
apply(some_dataset,2,function(
x){
x
7 matches
Mail list logo