mjwestgate / revtools

Tools to support research synthesis in R
https://revtools.net
51 stars 26 forks source link

screen_abstracts doesn't remember what's been screened? #26

Open thomased opened 5 years ago

thomased commented 5 years ago

Hi Martin — great package, thanks.

Correct me if I'm doing something silly, but screen_abstracts() doesn't seems to be picking up where I left off in the way that screen_titles() does. Quick eg:

# Load data
dat <- read_bibliography(system.file("extdata/avian_ecology_bibliography.ris", package = "revtools"))

# Pretend it's been screened
dat$selected <- 'selected'
dat$color <- '#405d99'

# This is all highlighted as expected, with 'screening complete' (20/20) etc.
screen_titles(dat)

# This doesn't seem to know anything has been screened
screen_abstracts(dat)

sessionInfo() R version 3.5.2 (2018-12-20) Platform: x86_64-apple-darwin15.6.0 (64-bit) Running under: macOS Mojave 10.14.6 Matrix products: default BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib locale: [1] en_AU.UTF-8/en_AU.UTF-8/en_AU.UTF-8/C/en_AU.UTF-8/en_AU.UTF-8 attached base packages: [1] stats graphics grDevices utils datasets methods base
other attached packages: [1] revtools_0.4.0

mjwestgate commented 4 years ago

Hi Tom, thanks for spotting this! I've been working on the screening apps a bit behind the scenes, but the updates aren't complete yet. Feel free to try the current GitHub version and see if that improves things; but I suspect it won't, so I'll try and look at this specific problem next week.

L-ENA commented 4 years ago

Hi Martin, I think I am running into the same problem - when calling screen_titles() and assigning the output to an object via command line I can see my screening results as data frame, but if I use screen_abstracts() it just shows in all columns.When trying to save to csv via the GUI there is no new file appearing (at least not in my working directory)...

I started using revtools today and am new to R, so maybe I am just making some obvious mistakes... Sorry if that is the case, I don't want to waste your time!

Here the full code:

` install.packages("revtools") # install from CRAN devtools::install_github("mjwestgate/revtools") # install from GitHub library(revtools) # load

dat <- read_bibliography(system.file("SearchTest18-19.txt", package = "revtools"))

dataAbstracts <- screen_abstracts(dat)# alternatively, I simply called screen_abstracts() because read_bibliography did not work for me at this point

`

Additionally, this line throws an error, but the file is definitly present in the working directory:

dat <- read_bibliography(system.file("SearchTest18-19.txt", package = "revtools"))

dat <- read_bibliography(system.file("SearchTest18-19.txt", package = "revtools")) Error in read_bibliography(system.file("SearchTest18-19.txt", package = "revtools")) : file not found

mjwestgate commented 4 years ago

Hi! Sorry for the slow reply. I'm not sure I have all the answers to these problems yet, but here are some options.

The import problem is easiest to fix - just remove the system.file command, i.e. dat <- read_bibliography("SearchTest18-19.txt") That should work fine.

re: saving back to the workspace - it probably isn't clear that for this to work, you need to click 'exit app' in the data tab. I've just pushed a change to the GitHub version to label this as 'Save to Workspace' instead, so that should be a bit clearer. If you exit the app by hitting 'escape' (my standard method) then no data are saved to the workspace at all.

re: failing to save to file - that's really weird - I don't know why that's happening. I've fixed Thomas's issue (see above) in v0.4.1 but I'll have another look and see what I can find.

BTW you don't need to install revtools from both CRAN and GitHub; you can just pick one. If you want to try the new changes I've mentioned stick with the GitHub version using devtools::install_github("mjwestgate/revtools")

I think that's all - let me know if I missed anything!