Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't install COVIDreportwriter #1

Open
jasonbouziotis opened this issue Apr 28, 2020 · 46 comments
Open

Can't install COVIDreportwriter #1

jasonbouziotis opened this issue Apr 28, 2020 · 46 comments

Comments

@jasonbouziotis
Copy link

Dear contributors,
I'm stuck...
Do you understand this?
Thanks for your help.

install("COVIDreportwriter", dependencies = TRUE)
Error in (function (command = NULL, args = character(), error_on_status = TRUE, : DESCRIPTION’ ...
System command 'R' failed, exit status: 1, stdout & stderr were printed
Type .Last.error.trace to see where the error occured
.Last.error.trace

Stack trace:

  1. devtools:::install("COVIDreportwriter", dependencies = TRUE)
  2. pkgbuild::with_build_tools(required = FALSE, callr::rcmd("INSTALL", ...
  3. callr::rcmd("INSTALL", c(install_path, opts), echo = !quiet, ...
  4. callr:::run_r(options)
  5. base:::with(options, with_envvar(env, do.call(processx::run, ...
  6. base:::with.default(options, with_envvar(env, do.call(processx::run, ...
  7. base:::eval(substitute(expr), data, enclos = parent.frame())
  8. base:::eval(substitute(expr), data, enclos = parent.frame())
  9. callr:::with_envvar(env, do.call(processx::run, c(list(bin, args = real_cmdargs, ...
  10. base:::force(code)
  11. base:::do.call(processx::run, c(list(bin, args = real_cmdargs, ...
  12. (function (command = NULL, args = character(), error_on_status = TRUE, ...
  13. throw(new_process_error(res, call = sys.call(), echo = echo, ...

x System command 'R' failed, exit status: 1, stdout & stderr were printed

@mdhall272
Copy link
Contributor

Not sure what this could be yet - could you try sessionInfo() and paste the results?

@jasonbouziotis
Copy link
Author

Thanks for your answer!

sessionInfo()
R version 4.0.0 (2020-04-24)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Mojave 10.14.6

Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRblas.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] devtools_2.3.0 usethis_1.6.0

loaded via a namespace (and not attached):
[1] prettyunits_1.1.1 ps_1.3.2 fansi_0.4.1 rprojroot_1.3-2 withr_2.2.0 digest_0.6.25 crayon_1.3.4
[8] assertthat_0.2.1 R6_2.4.1 backports_1.1.6 magrittr_1.5 rlang_0.4.5 cli_2.0.2 remotes_2.1.1
[15] fs_1.4.1 testthat_2.3.2 callr_3.4.3 ellipsis_0.3.0 desc_1.2.0 tools_4.0.0 glue_1.4.0
[22] pkgload_1.0.2 compiler_4.0.0 processx_3.4.2 pkgbuild_1.0.7 sessioninfo_1.1.1 memoise_1.1.0

@mdhall272
Copy link
Contributor

Oh, I haven't tested under R 4. Thanks, will get onto it ASAP.

@mdhall272
Copy link
Contributor

Looks like there was a dependency missing. Pull and try again now?

@jasonbouziotis
Copy link
Author

There is still a problem.

library(devtools)
install("COVIDreportwriter", dependencies = TRUE)
Installing 2 packages: psych, mnormt
trying URL 'https://lib.ugent.be/CRAN/bin/macosx/contrib/4.0/psych_1.9.12.31.tgz'
Content type 'application/x-gzip' length 3786158 bytes (3.6 MB)
==================================================
downloaded 3.6 MB

trying URL 'https://lib.ugent.be/CRAN/bin/macosx/contrib/4.0/mnormt_1.5-6.tgz'
Content type 'application/x-gzip' length 105909 bytes (103 KB)

downloaded 103 KB

The downloaded binary packages are in
/var/folders/ll/bv333331523_8fkwjxzncx1r0000gn/T//RtmpjCphZR/downloaded_packages
checking DESCRIPTION meta-information ...
Error in (function (command = NULL, args = character(), error_on_status = TRUE, :
System command 'R' failed, exit status: 1, stdout & stderr were printed
Type .Last.error.trace to see where the error occured
rror in (function (command = NULL, args = character(), error_on_status = TRUE, :

.Last.error.trace

Stack trace:

  1. devtools:::install("COVIDreportwriter", dependencies = TRUE)
  2. pkgbuild::with_build_tools(required = FALSE, callr::rcmd("INSTALL", ...
  3. callr::rcmd("INSTALL", c(install_path, opts), echo = !quiet, ...
  4. callr:::run_r(options)
  5. base:::with(options, with_envvar(env, do.call(processx::run, ...
  6. base:::with.default(options, with_envvar(env, do.call(processx::run, ...
  7. base:::eval(substitute(expr), data, enclos = parent.frame())
  8. base:::eval(substitute(expr), data, enclos = parent.frame())
  9. callr:::with_envvar(env, do.call(processx::run, c(list(bin, args = real_cmdargs, ...
  10. base:::force(code)
  11. base:::do.call(processx::run, c(list(bin, args = real_cmdargs, ...
  12. (function (command = NULL, args = character(), error_on_status = TRUE, ...
  13. throw(new_process_error(res, call = sys.call(), echo = echo, ...

x System command 'R' failed, exit status: 1, stdout & stderr were printed

@mdhall272
Copy link
Contributor

Try pulling once more? I've fixed the documentation which might have been the problem.

@jasonbouziotis
Copy link
Author

Seems I'm getting further but there are still problems after :).
Sorry for the long output:
errorlog.pdf
Thanks for your help.

@mdhall272
Copy link
Contributor

mdhall272 commented Apr 28, 2020

No need to apologise, this is a necessary part of the process for us and thanks for trying this out. I think I've now fixed that, try again?

@jasonbouziotis
Copy link
Author

Almost identical messages:
log.pdf

@mdhall272
Copy link
Contributor

Different source, though. Try once more. This definitely works on my machine with a clean workspace.

@jasonbouziotis
Copy link
Author

Still problems.
I do re-download the zip and re-launch R every time.
Do you also get warnings after library(COVIDreportwriter)?
And warnings after imported.data <- import.and.process.data("data.csv", "data_dict.csv")?
log3.pdf

@mdhall272
Copy link
Contributor

The problem there was that I forgot to push. Sorry. Try now.

Ignore the warnings for now. I'll try to fix it so unimportant ones are suppressed in a future release.

@jasonbouziotis
Copy link
Author

Ok.
Different messages at the end:
log4.pdf

@mdhall272
Copy link
Contributor

mdhall272 commented Apr 28, 2020

OK, this is where we might have to customise based on your dataset. What's the column for sex named (if you have one)?

@jasonbouziotis
Copy link
Author

My export don't have the column sex.
I exported the full dataset from ISARIC_nCoV but with the "remove tagged identifiers" default option.
I don't have the right to change this setting.
Sex is defined as an identifier in the project.

@mdhall272
Copy link
Contributor

OK. I'll see if there's a quick fix to the issue of having no sex field.

@mdhall272
Copy link
Contributor

Are there other common fields you are missing (age etc)? Best we don't go through the same thing several more times!

@jasonbouziotis
Copy link
Author

Only two: sex and age_estimateyears.

@mdhall272
Copy link
Contributor

mdhall272 commented Apr 28, 2020

Give it a try now. Several plots depend on age or sex, and for the present we print an error message if we don't have the information to generate them. In near future we'd like to allow customisation of what appears in the report.

@jasonbouziotis
Copy link
Author

Good morning :).
Fewer but different error messages:
log1.pdf

@emmanuelle-dankwa
Copy link
Collaborator

Hi Jason, good morning. The error was likely caused by insufficient outcome dates in your data. We have adapted the code to suit such cases. Could you please pull again and let us know what you get?

@jasonbouziotis
Copy link
Author

Other message:
log2.pdf

@emmanuelle-dankwa
Copy link
Collaborator

Sure, pull now?

@jasonbouziotis
Copy link
Author

log3.pdf

@mdhall272
Copy link
Contributor

mdhall272 commented Apr 29, 2020

I've pushed something which should at least prevent this error (I hope). But this may be a sign of more fields that you lack and we've been assuming that users have. What are the names of your admission, onset and discharge date variables?

@jasonbouziotis
Copy link
Author

They are the variable names defined by ISARIC_nCoV:

  • admission date = hostdat
  • onset date = cestdat
  • outcome date = dsstdtc
    I do have data for them.

@mdhall272
Copy link
Contributor

mdhall272 commented Apr 29, 2020

OK. That's what we have. Are any of them missing for any patients at all? (In particular for hostdat, which I think we always have.)

@mdhall272
Copy link
Contributor

Did the push help?

@jasonbouziotis
Copy link
Author

Yes out of 388 records in that export there are 8 cestdat missing, 1 hostdat missing and 129 dsstdtc missing.
Latest log:
log4.pdf

@mdhall272
Copy link
Contributor

mdhall272 commented Apr 29, 2020

I can guess what might be causing this, but it's only a guess. I've pushed the guess; give it a try. We're certainly at the point that different groups' Redcap variations are a problem and I'm flying slightly blind. I don't suppose there's any chance of sharing the data with me?

@jasonbouziotis
Copy link
Author

Hello.
Here's the latest log:
log1.pdf
I will ask permission to my bosses to share the data. As it is without identifiers and with date shifting I personally don't see the problem (I would send it to you by mail at [email protected] then?).

@jasonbouziotis
Copy link
Author

Good morning.
Here's my latest try:
Log_20200504_1.pdf

@mdhall272
Copy link
Contributor

My colleague @DebbieMalden ran into this - I've asked how she fixed it. We should add LaTeX installation instructions to the readme.

@DebbieMalden
Copy link
Collaborator

Hi Jason - thanks for your support here. I tried a few things, but I think this worked: tinytex::install_tinytex()

@jasonbouziotis
Copy link
Author

Oh my god.
It. actually. works.
It's amazing.
Thank you so much!!!
I will have to analyse that more closely soon.
Putting again the log so you can see remaining messages:
Log 20200504 2.pdf

@DebbieMalden
Copy link
Collaborator

Fantastic! It's a great feeling getting code to work! Thank you so much for working through these issues - Let us know if you have any other problems at all!

@jasonbouziotis
Copy link
Author

Is the code supposed to work with age and sex too?
Because I tried to run it with a filtered export from our own REDCap project that does contain age and sexe (I import the data in ISARIC_nCoV) but it doesn't work...
I'm trying to understand why...
Log 20200505.pdf

@jasonbouziotis
Copy link
Author

I even merged sex and age_estimateyears in the exact csv file that works with the code... And just buy adding these two variables it doesn't work anymore... Same end message as the log I sent an hour ago.

@mdhall272
Copy link
Contributor

This is a known issue and we are on it. Basically the code is currently expecting at least some NAs and is failing when it finds none. Fix soon.

@emmanuelle-dankwa
Copy link
Collaborator

emmanuelle-dankwa commented May 5, 2020

Hi Jason, thanks for doing this. It's been fixed now. Could you please re-install and run again? Let us know what you get.

@jasonbouziotis
Copy link
Author

Still doesn't work for me (with age_estimateyears and sex - I merged these two "columns" at the end of the csv).
Log 20200506.pdf

@emmanuelle-dankwa
Copy link
Collaborator

Hi Jason, I've looked at your log file. It is highly likely that you still have the old package folder since the variable causing the error is no longer in the code. Please detach the package, delete the COVIDReportwriter folder from the libs folder and re-install.

@jasonbouziotis
Copy link
Author

Ok it works :)!!! Yay! Thanks again very much!

@emmanuelle-dankwa
Copy link
Collaborator

Super! Thanks a lot for testing this.

@jasonbouziotis
Copy link
Author

I have problems with figures 4 to 7 though (see the legends, texts are overlapping - and the figure 7 doesn't work at all).
Problems with figures.pdf

@emmanuelle-dankwa
Copy link
Collaborator

Hi Jason, the figure lengths have now been fixed. Thank you! Try again?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants