R/var_selection.R

Defines functions var.selection

var.selection<-function(cluster_fun,cluster,k,x,p.adjust,alpha,clusterFirst=FALSE){
  selected_features=list()
  for (j in 2:k){
    if (clusterFirst==TRUE){cluster <- cluster_fun(x, j)$cluster}
  pvals<-apply(x,2,function(x) summary(stats::aov(x~cluster))[[1]][1,5])
  selected_features[[j]]=which(p.adjust(pvals,p.adjust)<alpha)
  }
  return(selected_features)}

Try the UNPaC package in your browser

Any scripts or data that you put into this service are public.

UNPaC documentation built on June 10, 2022, 1:06 a.m.