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

Creating a document feature matrix #37

Open lmoliner opened 4 years ago

lmoliner commented 4 years ago

Hi all, I'm new to R and I'm trying to use this package for a literature review, I watched the video on youtube and read the paper and it looks really good. I'm having the error below when using the create_dfm command:

> naive_chiros_dfm <- litsearchr::create_dfm(elements = paste(nr_chiros_data3$title, nr_chiros_data3$abstract),features = all_keywords)
> Loading required namespace: stopwords
> Error in nchar(lookup$initial) : invalid multibyte string, element 261

It's probably quite straightforward but I'm stuck and can't continue with the next steps so I'd really appreciate some help. Thank you very much in advance.

elizagrames commented 4 years ago

Looks like a non-standard character that R can't interpret. Check paste(nr_chiros_data3$title, nr_chiros_data3$abstract)[261] for anything out of the ordinary (e.g. a copyright symbol, whitespace masquerading as a space, a unicode character, etc.) and remove it. Some people have also solved this problem by opening the bibliographic file in a reference manager (e.g. Zotero) and re-saving it.