Description Usage Arguments Examples
Function to check if variables in leftlist are in either absgroup1 or absgroup2. This is necessary, otherwise there has been made a mistake in the given absgroups.
1 | match_dir_edges(leftlist, rightlist, absgroup1)
|
leftlist |
|
rightlist |
|
absgroup1 |
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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | ##---- 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 (leftlist, rightlist, absgroup1)
{
result <- "error"
group1 <- FALSE
group2 <- FALSE
for (i in leftlist) {
if (i %in% absgroup1) {
group1 <- TRUE
}
else {
group2 <- TRUE
}
}
if (group1 && group2) {
return(result)
}
if (group1) {
for (i in rightlist) {
if (i %in% absgroup1) {
group1 <- FALSE
}
else {
group2 <- TRUE
}
}
if (group1 && group2) {
cat("Nice! The abstraction matches with the pattern.")
result <- "left"
return(result)
}
}
else if (group2) {
for (i in rightlist) {
if (i %in% absgroup1) {
group1 <- TRUE
}
else {
group2 <- FALSE
}
}
if (group1 && group2) {
cat("Nice! The abstraction matches witht he pattern.")
result <- "right"
return(result)
}
else {
return(result)
}
}
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.