elizagrames / litsearchr

litsearchr is an R package to partially automate search term selection for systematic reviews using keyword co-occurrence networks. In addition to identifying search terms, it can write Boolean searches and translate them into over 50 languages.
https://elizagrames.github.io/litsearchr
101 stars 24 forks source link

max_n not implemented for method="tagged" #35

Closed luketudge closed 4 years ago

luketudge commented 4 years ago

In extract_terms(), the max_n argument has no effect when method="tagged".

For example:

extract_terms(
  keywords = c(
    "Cross-scale occupancy dynamics and postfire specialist and variation and fire regime",
    "Variation and home-range and Black-backed Woodpecker",
    "Black-backed woodpecker and occupancy and burned and beetle-killed and forests"
  ),
  method = "tagged",
  min_freq=1,
  min_n=2,
  max_n=2
)

Still returns "cross-scale occupancy dynamics" among the results despite max_n=2.

It looks as though this is because line 65 of term_selection.R is missing a <= condition against max_n.

elizagrames commented 4 years ago

Thank you for finding these issues and fixing them! Absolutely brilliant.

luketudge commented 4 years ago

Thanks for responding so quickly. It's great to see that I can already install the updated version and keep working with the package. Thanks!