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.

Home Page:https://elizagrames.github.io/litsearchr

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error when trying to create Boolean search

de5ham opened this issue · comments

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

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")`

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!

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!