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

import_results cannnot find the files #32

Closed EricQLi closed 4 years ago

EricQLi commented 4 years ago

I have downloaded the files from wos and scopus, and stored them in a file directory. When I used "naiveimport <- import_results(directory = search_directory, verbose = TRUE)", it hints that: Error in synthesisr::read_refs(filename = filename, return_df = TRUE, : file not found. Furthmore, I have tried the code of litsearchr_vignette_v030, and it hints the same error. Is there any bugs in the package, or how can I fix it?

elizagrames commented 4 years ago

I can't reproduce this error in the vignette, but I have gotten it when I supply a path to a directory that either is not absolute or starts not in your working directory. I would check that the path to your search results directory is correct in relation to your working directory.

hkuritaoyamada commented 4 years ago

Hi Eliza, I have the same issue...

library(litsearchr) getwd() [1] "C:/Users/hkuritaoyamada/OneDrive - University of Florida/Systematic_Review/litsearchr" list.files("./extdata/") [1] "savedrecs.txt" search_directory <- system.file("savedrecs.txt", package="synthesisr") search_directory [1] "" naiveimport <- litsearchr::import_results("savedrecs.txt", verbose = TRUE) Error in synthesisr::read_refs(filename = filename, return_df = TRUE, : file not found `

As you can see "search_directory" doesn't have anything just ""

I made sure that I'm in the corresponding working directory and that list.files sees the files in the folder. But still, import_results doesn't work.

elizagrames commented 4 years ago

list.files() is showing savedrecs.txt in the ./extdata/ directory, so you'll need to change the filename to the full path to savedrecs.txt

naiveimport <- litsearchr::import_results("./extdata/savedrecs.txt", verbose = TRUE)