# NOT RUN {
###################################
# Example with serial processing.
###################################
library(gRbase)
library(igraph)
#load the data
data(qsbralks)
x <- as.matrix(qsbralks[,1:15])
y <- as.matrix(qsbralks[,22])
# Get the graph
# Call GLSE(.) .
results <- GLSE(x,y,parallel=FALSE)
# The returned objects are
results$Graph
results$Beta
results$SSE
results$Error
# Call plotG(.).
plotG(results$Graph)
###################################
# Example with parallel processing.
###################################
library(gRbase)
library(igraph)
library(parallel)
#load the data
data(qsbralks)
x <- qsbralks[,1:15]
y <- qsbralks[,22]
# Create cluster
cl <- makeCluster(2)
# Send the gRbase package to all the nodes
clusterEvalQ(cl, library(gRbase))
# Call GLSE(.) .
results <- GLSE(x,y,parallel=TRUE,clusters=cl)
# Stop the cluster
stopCluster(cl)
# The returned objects are
results$Graph;
results$Beta;
results$SSE;
results$Error;
# Call plotG(.) .
plotG(results$Graph)
# }
Run the code above in your browser using DataLab