Skip to contents

Outputs queries removed by kwr_prune

Usage

kwr_removed_queries(kwr, q = NULL)

Arguments

kwr

A kwresearch object.

q

An optional regular expression to filter the output queries.

Value

A tibble with queries removed by kwr_prune.

Examples

queries <- data.frame(
  query = c("seo", "keyword research", "nonsense"),
  volume = c(1000, 500, 10)
)
kwr <- kwresearch(queries)

recipe_file <- file.path(tempdir(), "my-recipes.yml")
kwr_add_pattern(
  pattern = "nonsense",
  recipe_file = recipe_file,
  recipe_type = "remove"
)
kwr <- kwr_prune(kwr, recipe_file)
#> Removing queries...
#> Removed 1 queries out of 3. Duration: 0.003s
kwr_removed_queries(kwr)
#> # A tibble: 1 × 7
#>   query_normalized n_queries volume   cpc query_original input source
#>   <chr>                <int>  <dbl> <dbl> <chr>          <chr> <chr> 
#> 1 nonsense                 1     10    NA nonsense       NA    NA    

file.remove(recipe_file)
#> [1] TRUE