Description Usage Arguments Examples
Function to check the direction of the variables in dir_list. Assumptions: the variables in the abs_groups are directed equally, and there is at least 1 directed edge in abs_group1. (this has been checked before the function is called)
1 | check_direction(pdag, dir_list, abs_group1)
|
pdag |
|
dir_list |
|
abs_group1 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (pdag, dir_list, abs_group1)
{
a <- dir_list[[1]]
b <- dir_list[[2]]
if (pdag[a, b] == 1 & pdag[b, a] == 0) {
cat("the edge is directed as ", a, "->", b)
if (a %in% abs_group1) {
return(group1 <- TRUE)
}
else {
return(group1 <- FALSE)
}
}
if (pdag[b, a] == 1 & pdag[a, b] == 0) {
cat("the edge is directed as ", a, "<-", b)
}
if (b %in% abs_group1) {
return(group1 <- FALSE)
}
else {
return(group1 <- TRUE)
}
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.