Bug: Warning() at end of file overrides result
What happened?
It looks like warning() function overrides the final result from the script.
FYI @kodesiba @nicholas-masel
Session Information
This log was generated using logrx 0.2.1.0.0.0.1675442722 logrx package version: 0.2.1.0.0.0.1675442722 logrx build: RSPM (R 4.2.1) logrx link to repository: https://github.com/pharmaverse/logrx
─ Session info ───────────────────────────────────────────────────────────────── setting value version R version 4.2.1 (2022-06-23) os Red Hat Enterprise Linux system x86_64, linux-gnu ui RStudio language (EN) collate en_US.UTF-8 ctype en_US.UTF-8 tz America/New_York date 2023-02-09 rstudio 2022.02.3+492.pro3 Prairie Trillium (server) pandoc 2.17.1.1 @ /usr/lib/rstudio-server/bin/quarto/bin/ (via rmarkdown)
─ Packages ───────────────────────────────────────────────────────────────────── package * version date (UTC) lib source admiral * 0.9.1 2022-12-23 [1] RSPM (R 4.2.1) admiraldev 0.2.0 2022-12-01 [1] RSPM (R 4.2.1) assertthat 0.2.1 2019-03-21 [2] RSPM (R 4.2.1) cachem 1.0.6 2021-08-19 [2] RSPM (R 4.2.1) callr 3.7.1 2022-07-13 [2] RSPM (R 4.2.1) cli 3.3.0 2022-04-25 [2] RSPM (R 4.2.1) crayon 1.5.1 2022-03-26 [2] RSPM (R 4.2.1) cyclocomp 1.1.0 2016-09-10 [1] RSPM (R 4.2.1) DBI 1.1.3 2022-06-18 [2] RSPM (R 4.2.1) desc 1.4.1 2022-03-06 [2] RSPM (R 4.2.1) devtools * 2.4.3 2021-11-30 [2] RSPM (R 4.2.1) digest 0.6.29 2021-12-01 [2] RSPM (R 4.2.1) dplyr 1.0.9 2022-04-28 [2] RSPM (R 4.2.1) ellipsis 0.3.2 2021-04-29 [2] RSPM (R 4.2.1) evaluate 0.15 2022-02-18 [2] RSPM (R 4.2.1) fansi 1.0.3 2022-03-24 [2] RSPM (R 4.2.1) fastmap 1.1.0 2021-01-25 [2] RSPM (R 4.2.1) fs 1.5.2 2021-12-08 [2] RSPM (R 4.2.1) generics 0.1.3 2022-07-05 [2] RSPM (R 4.2.1) glue 1.6.2 2022-02-24 [2] RSPM (R 4.2.1) hms 1.1.1 2021-09-26 [2] RSPM (R 4.2.1) htmltools 0.5.2 2021-08-25 [2] RSPM (R 4.2.1) httpuv 1.6.5 2022-01-05 [2] RSPM (R 4.2.1) knitr 1.39 2022-04-26 [2] RSPM (R 4.2.1) later 1.3.0 2021-08-18 [2] RSPM (R 4.2.1) lazyeval 0.2.2 2019-03-15 [2] RSPM (R 4.2.1) lifecycle 1.0.1 2021-09-24 [2] RSPM (R 4.2.1) lintr 3.0.0 2022-06-13 [1] RSPM (R 4.2.1) logrx 0.2.1.0.0.0.1675442722 2023-02-03 [1] RSPM (R 4.2.1) lubridate 1.8.0 2021-10-07 [2] RSPM (R 4.2.1) magrittr 2.0.3 2022-03-30 [2] RSPM (R 4.2.1) memoise 2.0.1 2021-11-26 [2] RSPM (R 4.2.1) mime 0.12 2021-09-28 [2] RSPM (R 4.2.1) miniUI 0.1.1.1 2018-05-18 [2] RSPM (R 4.2.1) pillar 1.7.0 2022-02-01 [2] RSPM (R 4.2.1) pkgbuild 1.3.1 2021-12-20 [2] RSPM (R 4.2.1) pkgconfig 2.0.3 2019-09-22 [2] RSPM (R 4.2.1) pkgload 1.3.0 2022-06-27 [2] RSPM (R 4.2.1) prettyunits 1.1.1 2020-01-24 [2] RSPM (R 4.2.1) processx 3.7.0 2022-07-07 [2] RSPM (R 4.2.1) promises 1.2.0.1 2021-02-11 [2] RSPM (R 4.2.1) ps 1.7.1 2022-06-18 [2] RSPM (R 4.2.1) purrr 0.3.4 2020-04-17 [2] RSPM (R 4.2.1) R6 2.5.1 2021-08-19 [2] RSPM (R 4.2.1) Rcpp 1.0.9.0.0.0.1657464909 2022-07-15 [2] RSPM (R 4.2.1) remotes 2.4.2 2021-11-30 [2] RSPM (R 4.2.1) rex 1.2.1 2021-11-26 [2] RSPM (R 4.2.1) rlang 1.0.4 2022-07-12 [2] RSPM (R 4.2.1) rmarkdown 2.14 2022-04-25 [2] RSPM (R 4.2.1) rprojroot 2.0.3 2022-04-02 [2] RSPM (R 4.2.1) rstudioapi 0.13 2020-11-12 [2] RSPM (R 4.2.1) sessioninfo 1.2.2 2021-12-06 [2] RSPM (R 4.2.1) shiny 1.7.1 2021-10-02 [2] RSPM (R 4.2.1) stringi 1.7.8 2022-07-11 [2] RSPM (R 4.2.1) stringr 1.4.0 2019-02-10 [2] RSPM (R 4.2.1) tibble * 3.1.7 2022-05-03 [2] RSPM (R 4.2.1) tidyr 1.2.0 2022-02-01 [2] RSPM (R 4.2.1) tidyselect 1.1.2 2022-02-21 [2] RSPM (R 4.2.1) usethis * 2.1.6 2022-05-25 [2] RSPM (R 4.2.1) utf8 1.2.2 2021-07-24 [2] RSPM (R 4.2.1) vctrs 0.4.1 2022-04-13 [2] RSPM (R 4.2.1) waiter 0.2.5 2022-01-03 [1] RSPM (R 4.2.1) withr 2.5.0 2022-03-03 [2] RSPM (R 4.2.1) xfun 0.31 2022-05-10 [2] RSPM (R 4.2.1) xml2 1.3.3 2021-11-30 [2] RSPM (R 4.2.1) xtable 1.8-4 2019-04-21 [2] RSPM (R 4.2.1) yaml 2.3.5 2022-02-21 [2] RSPM (R 4.2.1)
[1] /shared-scratch/area/bs832471/R/libs/4.2.1 [2] /shared-app/R-4.2.1/lib64/R/library
─ External software ──────────────────────────────────────────────────────────── setting value cairo 1.15.12 cairoFT pango 1.42.3 png 1.5.13 jpeg 6.2 tiff LIBTIFF, Version 4.0.3 tcl 8.5.13 curl 7.29.0 zlib 1.2.7 bzlib 1.0.6, 6-Sept-2010 xz 5.2.2 PCRE 10.23 2017-02-14 ICU 50.1.2 TRE TRE 0.8.0 R_fixes (BSD) iconv glibc 2.17 readline 6.2 BLAS /usr/lib64/libblas.so.3.4.2 lapack /usr/lib64/liblapack.so.3.4.2 lapack_version 3.4.2
─ Python configuration ───────────────────────────────────────────────────────── Python is not available
────────────────────────────────────────────────────────────────────────────────
-
Masked Functions -
function %>% from {package:admiral} by package:tibble
function plot from {package:base} by package:graphics
function body<- from {package:base} by package:methods
function kronecker from {package:base} by package:methods
-
Used Package and Functions -
{package:admiral} derive_extreme_records, vars {package:base} library, message, warning {package:tibble} tribble
-
Program Run Time Information -
Start time: 2023-02-09 14:17:50 EST End time: 2023-02-09 14:17:50 EST Run time: 0 seconds
-
Errors and Warnings -
Errors:
Warnings: Warning - Ship is under attack! Warning - Loosing result
-
Messages, Output, and Result -
Messages: Hello R4GxP!
Result: [1] "Warning - Loosing result"
-
Log Output File -
Log name: demo_script2.log Log path: /shared-scratch/area/bs832471/logrx_demo
Reproducible Example
library(admiral) library(tibble)
adlb <- tribble( ~USUBJID, ~AVISITN, ~AVAL, ~LBSEQ, "1", 1, 113, 1, "1", 2, 113, 2, "1", 3, 117, 3, "2", 1, 101, 1, "2", 2, 101, 2, "2", 3, 95, 3 )
message("Hello R4GxP!") warning("Warning - Ship is under attack!")
derive_extreme_records( adlb, by_vars = vars(USUBJID), order = vars(AVISITN), mode = "last", set_values_to = vars( AVISITN = 99, DTYPE = "LOV" ) )
warning("Warning - Losing result if warning is at bottom of script")
Loosing or Losing :)
Try and Re-create this bug
Possible disclaimer in #178
Possible update to Get Started for Messages, Outputs, Results and explain how they work