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
103 stars 26 forks source link

error when trying to create Boolean search #38

Closed de5ham closed 4 years ago

de5ham commented 4 years ago

Hey! when I run this line of code: my_search<- litsearchr::write_search( groupdata = my_search_terms, languages ="English", exactphrase = TRUE, stemming = TRUE, closure = "None", writesearch = FALSE, verbose = TRUE ) I get this error: Error in grep(terms[n], terms[-n]) : invalid 'pattern' argument

any ideas? Thank you Dan

elizagrames commented 4 years ago

Looks like one of your search terms isn't being recognized as a valid string by grep, possibly a special character or symbol (maybe a specially formatted dash?). I can't really troubleshoot it without the list of search terms since all my random guesses of random characters don't reproduce the error. Could you run the code below and attach the .rda to the issue or email it to me and I will try to sort it out?

save(my_search_terms, file="issue38.rda")`

de5ham commented 4 years ago

Hey Eliza! Thanks for your quick reply. The problem was solved when I wrote the function with all arguments! Here what I have wrote:

my_search<- litsearchr::write_search( groupdata = my_search_terms, API_key = NULL, languages = "English", exactphrase = TRUE, stemming = TRUE, closure = "none", writesearch = FALSE, verbose = TRUE) Thank you!

elizagrames commented 4 years ago

I didn't catch in the first set of code that you had capitalized "None" for closure, which is likely the problem since capitalization matters. Glad it is worked out!