Skip to content
Prev 366894 / 398503 Next

[FORGED] filter correlation data

On 01/02/17 10:34, Elham - via R-help wrote:

            
(a) In this instance it doesn't really matter, but *PLEASE* stop posting 
in HTML.

(b) It's not at all clear what the structure of your (table? matrix? 
data frame) is.  Please learn to be precise and explicit, otherwise it 
is difficult-to-impossible to provide useful advice.  (I.e. don't expect 
us to be mind-readers.)

Let us suppose (for the sake of saying *something* that might be 
helpful) that your correlations and p-values are stored in a data frame 
"X" as columns named "r" and "pval".

Then assign

ok <- with(X, (r < -0.9 | r > 0.9) & pval < 0.001)
Y  <- X[ok,]

Then export Y.

Really, if you are going to use R you should learn something about R.

cheers,

Rolf Turner

P.S.  Note that your p-value < 0.001 condition is redundant for any 
sample size greater than or equal to 7.

R. T.