Outputs pruned queries
Arguments
- kwr
A
kwresearch
object.- q
An optional regular expression to filter the output queries.
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_pruned_queries(kwr)
#> # A tibble: 2 × 7
#> query_normalized n_queries volume cpc query_original input source
#> <chr> <int> <dbl> <dbl> <chr> <chr> <chr>
#> 1 seo 1 1000 NA seo NA NA
#> 2 keyword research 1 500 NA keyword research NA NA
file.remove(recipe_file)
#> [1] TRUE