match_dir_edges: match_dir_edges

Description Usage Arguments Examples

Description

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.

Usage

1
match_dir_edges(leftlist, rightlist, absgroup1)

Arguments

leftlist
rightlist
absgroup1

Examples

 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)
        }
    }
  }

gekepals/pcabs documentation built on June 15, 2019, 12:03 a.m.