Skip to content

Commit 90b5020

Browse files
committed
fix bug to include all factors
1 parent 5362273 commit 90b5020

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

R/corr_coef_class.R

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,16 @@ setMethod(f="method.apply",
8282

8383
out=apply(D$data,2,fcn)
8484
out=as.data.frame(t(out),stringsAsFactors = FALSE)
85+
out=as.data.frame(lapply(out,as.numeric))
86+
87+
p_val=as.data.frame(lapply(out[,seq(2,ncol(out),7)],p.adjust,method=M$mtc),row.names = colnames(D$data))
88+
colnames(p_val)=M$factor_names
89+
M$p_value=p_val
90+
91+
coeff=as.data.frame(out[,seq(3,ncol(out),7),drop=FALSE],row.names = colnames(D$data))
92+
colnames(coeff)=M$factor_names
93+
M$coeff=coeff
8594

86-
M$p_value=data.frame('p_value'=p.adjust(as.numeric(out[,2]),method=M$mtc),row.names = colnames(D$data))
87-
M$coeff=data.frame('coeff'=as.numeric(out[,3]),row.names = colnames(D$data))
8895
M$significant=data.frame('significant'=M$p_value<M$alpha,row.names = colnames(D$data))
8996

9097
return(M)

0 commit comments

Comments
 (0)