filterSubset: filterSubset

Description Usage Arguments Value Examples

View source: R/functions.R

Description

Filter up to two qualitative columns (source and target) in List for a subset of names.

Usage

1
2
3
filterSubset(List, sourceSubset = NULL, targetSubset = NULL,
  invert = FALSE, source = "source", target = "target",
  join = c("union", "intersect"))

Arguments

List

Data frame containing 6 columns: source, target, description, value, sourcefc, targetfc.

sourceSubset

Vector of source names to keep.

targetSubset

Vector of target names to keep.

invert

Take the inverse selection of defined subset.

source

Column name of List containing source names.

target

Column name of List containing target names.

join

If both subsets are defined, take either union or intersect of subsets found.

Value

a filtered List

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
tempList <- createList(data.frame(source=c("A","B","C"),
    target=c("D","E","G"),
    description=c("consonant","vowel","consonant"),
    value=runif(3,-1,1),
    sourcefc=runif(3,-2,2),
    targetfc=runif(3,-2,2)))
filterSubset(tempList,source="source", target="description", 
sourceSubset="C", targetSubset="consonant")
filterSubset(tempList,target="description", targetSubset="consonant")
filterSubset(tempList,target="description", targetSubset="consonant", invert=TRUE)

Director documentation built on Nov. 8, 2020, 5:55 p.m.