search for: resultscor

Displaying 1 result from an estimated 1 matches for "resultscor".

Did you mean: result_cor
2013 Feb 22
2
How to merge two functions into one?
...(dir1)) { file_tot[, , i, 1] <- readBin(dir1[i], numeric(), size = 4, n = 1440 * 720, signed = T) file_tot[, , i, 2] <- readBin(dir2[i], numeric(), size = 4, n = 1440 * 720, signed = T) } resultscor<-apply(file_tot,c(1,2),function(x){cor(x[,1],x[,2],use = "na.or.complete")}) I would like to calculate the correlation only when the `P-value is lower than 0.05`. so this function bellow will do the job: return_cor = function(x, y) { z = cor.test(x,y) if(z[[3]]...