R/pc.con.R

Defines functions pc.con

Documented in pc.con

#######################
#######################
##### Fast skeleton of the PC algorithm for continuous data only using pearson or spearman
#####
#######################
#######################
pc.con <- function(dataset, method = "pearson", alpha = 0.01) {
  ## dataset contains the data, it must be a matrix 
  title <- deparse( substitute(dataset) )
  res <- Rfast::pc.skel(dataset = dataset, method = method, alpha = alpha)
  info <- summary( Rfast::rowsums(res$G) )
  n <- dim(dataset)[2]
  density <- sum(res$G) / n / ( n - 1 ) 
  res$density <- density
  res$info <- info
  res$title <- title 
  res  
}

Try the MXM package in your browser

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

MXM documentation built on Aug. 25, 2022, 9:05 a.m.