Running examples in 'MRPC-Ex.R' failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: MRPC
> ### Title: Infer a causal network using the MRPC algorithm
> ### Aliases: MRPC
> 
> ### ** Examples
> 
> # Load packages
> # We compare different simulated data across six methods: MRPC, 
> # PC in pcalg (Kalisch et al., 2012), and pc.stable, mmpc mmhc and hc in
> # bnlearn (Marco Scutari, 2010)
> 
> library(MRPC)     # MRPC
> library(pcalg)    # pc
> library(bnlearn)  # pc.stable, mmpc, mmhc and hc

Attaching package: 'bnlearn'

The following objects are masked from 'package:pcalg':

    dsep, pdag2dag, shd, skeleton

> 
> # Data pre-processing
> # The 1st column of the input matrix will be the genotype of the
> # expression quantitative trait loci (eQTL)/Copy number variation (CNV)
> # and the remaining columns are the gene expression data.
> 
> # We used pre-assigned level alpha = 0.05 that ensures FDR and mFDR
> # will remain below 0.05.
> 
> # Load predefined simulated data
> # Model 1
> Truth <- MRPCtruth$M1   # Truth for model 1
> data <- simu_data_M1    # load data for model 1
> n <- nrow (data)        # Number of rows
> V <- colnames(data)     # Column names
> 
> # Calculate Pearson correlation
> suffStat_C <- list(C = cor(data),
+                    n = n)
> 
> # Infer the graph by MRPC
> MRPC.fit <- MRPC(data,
+                 suffStat = suffStat_C,
+                 GV = 1,
+                 FDR = 0.05,
+                 indepTest = 'gaussCItest',
+                 labels = V,
+                 FDRcontrol = TRUE,
+                 verbose = FALSE)
> 
> # Infer the graph by PC
> pc.fit <- pc(suffStat = suffStat_C,
+              indepTest = gaussCItest,
+              alpha = 0.05,
+              labels = V,
+              verbose = FALSE)
> 
> # arcs not to be included from gene expression to genotype used in pc.stable, mmpc 
> bl <- data.frame (from = colnames (data)[-1], 
+                   to = 'V1')
> 
> # Infer the graph by pc.stable
> pc.stable.fit <- pc.stable(data.frame(data),
+                            blacklist = bl,
+                            undirected = FALSE) 
> 
> # Infer the graph by mmpc
> mmpc.fit <- mmpc(data.frame(data),
+                  blacklist = bl,
+                  undirected = FALSE,
+                  debug = FALSE) 
> 
> # Infer the graph by mmhc
> mmhc.fit <- mmhc(data.frame(data),
+                  blacklist = bl,
+                  debug = FALSE)
> 
> # Infer the graph by hc
> hc.fit <- hc (data.frame (data), 
+                           blacklist = bl, 
+                           debug = FALSE)
> 
> # Plot the inferred graphs
> par(mfrow = c(1, 7))
> plot(Truth,
+      main = "(A) Truth")
> plot(MRPC.fit,
+      main = "(B) MRPC")
> plot(pc.fit,
+     main ="(C) pc")
> graphviz.plot(pc.stable.fit,
+     main = "(D) pc.stable")
> graphviz.plot(mmpc.fit,
+     main = "(E) mmpc")
> graphviz.plot(mmhc.fit,
+     main = "(F) mmhc")
> graphviz.plot(hc.fit,
+     main = "(G) hc")
>     
> # Another option for plot of the results. First fig is the nodes
> # dendrogram with colored modules. Second fig is the plot of the graph
> # with color based on modules.
> # To idendify modules and complex graph (Suitable if you have many nodes)
> # Adjacency matrix from directed graph
> Adj_directed <- as(MRPC.fit@graph,
+                    "matrix")
> 
> # Plot of dendrogram with modules colors of nodes
> PlotDendrogramObj <- PlotDendrogram(Adj_directed,
+                                     minModuleSize = 2)
..connectivity..
..matrix multiplication (system BLAS)..
..normalization..
..done.
 ..cutHeight not given, setting it to 0.248  ===>  99% of the (truncated) height range in dendro.
 cutHeight set too low: no merges below the cut.
>                   
> # Visualization of inferred graph with modules colors
> PlotGraphWithModulesObj <- PlotGraphWithModules(Adj_directed,
+                                                 PlotDendrogramObj,
+                                                 GV = 1,
+                                                 node.size = 8,
+                                                 arrow.size = 5,
+                                                 label.size = 3,
+                                                 alpha = 1) 
Error in set.vertex.attribute(g, "na", rep(FALSE, n), 1:n) : 
  attempt to set index 0/0 in SET_VECTOR_ELT
Calls: PlotGraphWithModules ... as.network.matrix -> network.initialize -> set.vertex.attribute
Execution halted