This function returns all unique entity identifiers of extractable entities that match a given regular expression. This means that identifiers of container entities or clustering entities are not returned!

rxsProject_matchingUniqueEntityIdentifiers(
  x,
  regex,
  includeValueListsOfMatch = TRUE,
  excludeParentWhenValueListReturned = TRUE
)

rxsTree_matchingUniqueEntityIdentifiers(
  rxsTree,
  regex,
  includeValueListsOfMatch = TRUE,
  excludeParentWhenValueListReturned = TRUE
)

rxsTree_matchingUniqueEntityIdentifiers(
  rxsTree,
  regex,
  includeValueListsOfMatch = TRUE,
  excludeParentWhenValueListReturned = TRUE
)

Arguments

x, rxsTree

The full Rxs project (i.e. parsed extraction scripts) or one single Rxs tree.

regex

The regular expression to use to find entity identifiers

includeValueListsOfMatch

Whether to also include the value lists inside matching entities (useful for quickly selecting e.g. all results)

excludeParentWhenValueListReturned

Whether, if an entity matches, has a value list as value, and those value lists are returns (i.e. includeValueListsOfMatch is TRUE), the parent entity (that matched the regular expression) should be excluded.

Value

A character vector of identifiers

Examples

### Load an example Rxs project
data('example_rxsProject_1', package="metabefor");

### Show all entity identifiers
metabefor::rxsProject_get_entityIds(
  example_rxsProject_1
);
#>  [1] "general"               "publicationYear"       "sourceAuthors"        
#>  [4] "sourceTitle"           "modeInfo"              "methods"              
#>  [7] "sample"                "sampleSize"            "samplingStrategy"     
#> [10] "method"                "variables"             "chalk"                
#> [13] "witches"               "crayons"               "instruments"          
#> [16] "associations"          "chalk_and_witches"     "criminals"            
#> [19] "cops"                  "criminals_and_cops"    NA                     
#> [22] "variableIdentifier"    "measurementLevel"      "associationIdentifier"
#> [25] "varId1"                "varId2"                "r"                    
#> [28] "t"                    

### Get all unique identifiers matching "method"
metabefor::rxsProject_matchingUniqueEntityIdentifiers(
  example_rxsProject_1,
  "od"
);
#>       name fromList
#> 1 modeInfo    FALSE
#> 2   method    FALSE