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

Cannot run any commands which depend on synthesisr #28

Closed GitNoise closed 4 years ago

GitNoise commented 4 years ago

Every command which is dependent on synthesisr fail.

For instance, running naiveresults <- litsearchr::remove_duplicates(naiveimport, field = "title", method = "stringdist") results in:

 Error in synthesisr::find_duplicates(data = df, match_variable = field,  : 
  unused argument (match_variable = field)

I am trying to follow the tutorial / example at https://elizagrames.github.io/litsearchr/litsearchr_vignette_v030.html.

I installed litsearcher like this:

To install litsearchr use devtools::install_github("elizagrames/litsearchr") 
in R or RStudio. You may need to install the devtools package if it is not 
already installed. This will also install all the litsearchr dependencies.
elizagrames commented 4 years ago

I'll look into it; synthesisr should have been installed automatically since it is a dependency but I must have misspecified it somewhere.

In the meantime: devtools::install_github("rmetaverse/synthesisr") will solve the problem.

kravitz-eli commented 4 years ago

@elizagrames

I am happy to help narrow down issues and debug. It would be helpful if you let us known which version of synthesir you're using, so I can install that version.

packageVersion("synthesisr")

‘0.2.0’

portitor commented 4 years ago

Hi, synthesisr 0.2.0 has changed some functions, not only in the implementation but also in the parameters specification. Currently, litsearchr::remove_duplicates calls synthesisr::find_duplicates with the wrong parameters, since the latest version of synthesisr::find_duplicates does not accept match_variable as a parameter. To overcome this problem, I used synthesisr::deduplicate directly. This allows finding and removing duplicates in a dataset, all in one go. I believe that litsearchr::remove_duplicates could be easily updated by making it call synthesisr::deduplicate directly. Hope this helps...

GitNoise commented 4 years ago

Maybe using dependency management tool would solve these issues.. I've seen multiple issues here before which seem to be dependent on version changes. Have a look at this: https://blog.learningtree.com/manage-packages-in-r-how/

GitNoise commented 4 years ago

My version is:

packageVersion("synthesisr") [1] ‘0.2.0’

kravitz-eli commented 4 years ago

Maybe using dependency management tool would solve these issues

Or just rewriting the functions that depend on synthesisr to get rid of the dependence. Litsearchr and synthesisr look like they're being developed independently. These issues will keep coming up.

@elizagrames could ask the synthesisr to merge projects or ask to (more-or-less) copy-paste their code into litsearchr.

elizagrames commented 4 years ago

So the long story short is that I write the code for both litsearchr and synthesisr and have somehow royally screwed things up. I moved the basic importing and deduplication code to synthesisr but retained wrapper functions in litsearchr because of descriptions in the published paper for litsearchr. When Martin updated the synthesisr dedupe functions, this broke litsearchr calls to it. I will sort out the discrepancies between packages ASAP.

Otoliths commented 4 years ago

Hi: Suggest modifications to the original _removeduplicates function:

remove_duplicates <- function (df,field, method = c("stringdist", "fuzzdist", "exact")) { df <- synthesisr::deduplicate(data=df, match_by=field, match_function = method) return(df) }

elizagrames commented 4 years ago

This is now fixed exactly as suggested.