Skip to contents

Keep rows that match a nested condition

Usage

filterNested(object, pattern, ...)

# S4 method for DFrame,character
filterNested(object, pattern, ignoreCase = FALSE)

Arguments

object

Object.

pattern

character(1). Pattern to use for matching.

ignoreCase

logical(1). Perform case insensitive pattern matching.

...

Additional arguments.

Value

Modified object, containing only matching rows.

Details

Intended for partial matching with regular expressions. For exact matches, refer to matchNested function.

Note

Updated 2023-12-12.

Examples

## DFrame ====
pattern <- "^[A-Z]+$"
object <- S4Vectors::DataFrame(
    "V1" = c("a", "b", "c"),
    "V2" = I(list(
        c("aa", "bb", "CC"),
        c("dd", "ee", "ff"),
        c("gg", "hh", "ii")
    ))
)
object <- filterNested(object = object, pattern = pattern)
print(object)
#> DataFrame with 1 row and 2 columns
#>            V1       V2
#>   <character>   <list>
#> 1           a aa,bb,CC