Search in data frame column if search term is not NULL
Examples
x <- dplyr::tibble(
y = 1:10,
z = letters[1:10])
search_in_if(df = x,
dfcol = x$z,
search = c("a", "j"))
#> # A tibble: 2 × 2
#> y z
#> <int> <chr>
#> 1 1 a
#> 2 10 j
search_in_if(df = x,
dfcol = x$z,
search = NULL)
#> # A tibble: 10 × 2
#> y z
#> <int> <chr>
#> 1 1 a
#> 2 2 b
#> 3 3 c
#> 4 4 d
#> 5 5 e
#> 6 6 f
#> 7 7 g
#> 8 8 h
#> 9 9 i
#> 10 10 j