Skip to content

Commit

Permalink
Dev (#18)
Browse files Browse the repository at this point in the history
* dev portfolio performance

* continued portf performance

* contin port perf

* refactoring portolio sims

* porf sim started completing tests

* portfolio perforamnce checks ok

* smooth out portf perf

* fixes in progress

* portfolio performance finished

* fix imports

Co-authored-by: bjoern koneswarakantha <erbast2001@gmx.de>
  • Loading branch information
erblast and bjoern koneswarakantha committed Nov 2, 2021
1 parent 6e0687b commit 1066de0
Show file tree
Hide file tree
Showing 127 changed files with 7,438 additions and 565 deletions.
3 changes: 3 additions & 0 deletions .Rbuildignore
Expand Up @@ -8,3 +8,6 @@
^README\.Rmd$
^\.github$
^.\.sas7bdat$
^Dockerfile$
^docker-compose.yml$
^.dockerignore$
2 changes: 2 additions & 0 deletions .dockerignore
@@ -0,0 +1,2 @@
.vscode
.git
8 changes: 8 additions & 0 deletions .gitignore
Expand Up @@ -11,3 +11,11 @@
*.sas7bdat

vignettes/do_not_commit.Rmd
vignettes/ae_profile.csv
vignettes/scen.csv
vignettes/scen_old.csv
vignettes/scen_days.csv
vignettes/*.html
run_remote.md
.vscode

16 changes: 7 additions & 9 deletions DESCRIPTION
@@ -1,6 +1,6 @@
Package: simaerep
Title: Simulate adverse event reporting in clinical trials with the goal of detecting under-reporting sites
Version: 0.3.1
Version: 0.3.2
Authors@R:
person(given = "Bjoern",
family = "Koneswarakantha",
Expand All @@ -16,9 +16,9 @@ License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
Depends:
ggplot2,
dplyr
ggplot2
Imports:
dplyr,
lintr,
tidyr,
magrittr,
Expand All @@ -28,18 +28,16 @@ Imports:
forcats,
cowplot,
RColorBrewer,
feather,
furrr (>= 0.2.1),
future
progressr,
knitr,
tibble
Suggests:
testthat,
devtools,
pkgdown,
knitr,
tibble,
spelling,
haven,
sqldf
haven
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.1.1
Language: en-US
4 changes: 4 additions & 0 deletions Dockerfile
@@ -0,0 +1,4 @@
FROM rocker/verse:4.1
COPY . /simaerep
RUN R -e "devtools::install('/simaerep/.', upgrade = 'never', dependencies = TRUE, repos = 'http://cran.us.r-project.org')"
RUN rm /simaerep -r -f
71 changes: 64 additions & 7 deletions NAMESPACE
Expand Up @@ -6,8 +6,10 @@ export(check_df_visit)
export(eval_sites)
export(eval_sites_deprecated)
export(exp_implicit_missing_visits)
export(get_config)
export(get_ecd_values)
export(get_pat_pool_config)
export(get_portf_perf)
export(lint_package)
export(pat_aggr)
export(pat_pool)
Expand All @@ -17,30 +19,79 @@ export(plot_sim_examples)
export(plot_study)
export(plot_visit_med75)
export(poiss_test_site_ae_vs_study_ae)
export(prep_for_sim)
export(prob_lower_site_ae_vs_study_ae)
export(purrr_bar)
export(sim_after_prep)
export(sim_scenario)
export(sim_sites)
export(sim_studies)
export(sim_test_data_patient)
export(sim_test_data_portfolio)
export(sim_test_data_study)
export(sim_ur_scenarios)
export(site_aggr)
import(dplyr)
import(furrr)
import(future)
export(with_progress_cnd)
import(ggplot2)
import(purrr)
import(tidyr)
importFrom(RColorBrewer,brewer.pal)
importFrom(cowplot,draw_label)
importFrom(cowplot,get_legend)
importFrom(cowplot,ggdraw)
importFrom(cowplot,plot_grid)
importFrom(feather,read_feather)
importFrom(feather,write_feather)
importFrom(dplyr,arrange)
importFrom(dplyr,between)
importFrom(dplyr,bind_cols)
importFrom(dplyr,bind_rows)
importFrom(dplyr,case_when)
importFrom(dplyr,dense_rank)
importFrom(dplyr,desc)
importFrom(dplyr,distinct)
importFrom(dplyr,everything)
importFrom(dplyr,filter)
importFrom(dplyr,group_by)
importFrom(dplyr,group_by_at)
importFrom(dplyr,inner_join)
importFrom(dplyr,is_grouped_df)
importFrom(dplyr,lag)
importFrom(dplyr,left_join)
importFrom(dplyr,mutate)
importFrom(dplyr,mutate_all)
importFrom(dplyr,mutate_at)
importFrom(dplyr,n)
importFrom(dplyr,n_distinct)
importFrom(dplyr,one_of)
importFrom(dplyr,pull)
importFrom(dplyr,rename)
importFrom(dplyr,right_join)
importFrom(dplyr,row_number)
importFrom(dplyr,sample_n)
importFrom(dplyr,select)
importFrom(dplyr,summarise)
importFrom(dplyr,summarise_all)
importFrom(dplyr,summarise_at)
importFrom(dplyr,ungroup)
importFrom(dplyr,vars)
importFrom(forcats,fct_relevel)
importFrom(furrr,furrr_options)
importFrom(furrr,future_map)
importFrom(furrr,future_pmap)
importFrom(knitr,kable)
importFrom(lintr,lint_package)
importFrom(magrittr,"%>%")
importFrom(progressr,progressor)
importFrom(progressr,with_progress)
importFrom(purrr,map)
importFrom(purrr,map2)
importFrom(purrr,map2_dbl)
importFrom(purrr,map_chr)
importFrom(purrr,map_dbl)
importFrom(purrr,map_int)
importFrom(purrr,pmap)
importFrom(purrr,pmap_dbl)
importFrom(purrr,possibly)
importFrom(purrr,safely)
importFrom(rlang,":=")
importFrom(rlang,.data)
importFrom(stats,ecdf)
importFrom(stats,median)
importFrom(stats,p.adjust)
Expand All @@ -49,6 +100,12 @@ importFrom(stats,quantile)
importFrom(stats,rnorm)
importFrom(stats,rpois)
importFrom(stats,runif)
importFrom(stats,sd)
importFrom(stringr,str_count)
importFrom(stringr,str_pad)
importFrom(tibble,tibble)
importFrom(tidyr,fill)
importFrom(tidyr,nest)
importFrom(tidyr,tibble)
importFrom(tidyr,unnest)
importFrom(utils,head)
5 changes: 4 additions & 1 deletion NEWS.md
@@ -1,3 +1,6 @@
# simaerep 0.3.2
- added portfolio performance assessment

# simaerep 0.3.1
- changed MIT License holder from openpharma to F. Hoffmann-La Roche Ltd and simaerep authors

Expand All @@ -8,4 +11,4 @@
# simaerep 0.2.0
- use Benjamin Hochberg procedure for alpha error correction
- fix warnings around parallel processing
- improved SAS files vignette
- improved SAS files vignette
32 changes: 32 additions & 0 deletions R/0_imports.R
@@ -0,0 +1,32 @@
# satisfy lintr
# lintr falsely flags possibly_ecdf as unused variable
# using rlang::.data here causes error with furrr in sim_test_data_portfolio
# patnum, n_ae, visit

if (getRversion() >= "2.15.1") {
utils::globalVariables(c("possibly_ecdf", "patnum", "n_ae", "visit"))
}

#' @importFrom progressr progressor
#' @importFrom cowplot get_legend plot_grid ggdraw draw_label plot_grid plot_grid
#' @importFrom cowplot ggdraw draw_label
#' @importFrom forcats fct_relevel
#' @importFrom RColorBrewer brewer.pal
#' @importFrom utils head
#' @importFrom stats p.adjust quantile median runif poisson.test ecdf rnorm rpois sd
#' @importFrom purrr safely possibly pmap map map2 pmap_dbl map2_dbl map_dbl
#' @importFrom purrr map_int map_chr
#' @importFrom furrr future_map future_pmap furrr_options
#' @importFrom progressr with_progress
#' @importFrom stringr str_count str_pad
#' @importFrom rlang := .data
#' @importFrom dplyr select mutate filter summarise group_by summarise_all summarise_at
#' @importFrom dplyr mutate_all mutate_at ungroup vars bind_cols bind_rows pull
#' @importFrom dplyr n_distinct distinct arrange right_join left_join inner_join
#' @importFrom dplyr rename sample_n between row_number dense_rank desc case_when
#' @importFrom dplyr group_by_at n is_grouped_df everything one_of lag
#' @importFrom tidyr tibble unnest nest fill
#' @importFrom lintr lint_package
#' @importFrom knitr kable
#' @importFrom tibble tibble
NULL
1 change: 0 additions & 1 deletion R/lint.R
Expand Up @@ -11,7 +11,6 @@
#' @seealso \code{\link[lintr]{lint_package}}
#' @rdname lint_package
#' @export
#' @importFrom lintr lint_package
lint_package <- function(path = ".", ...) {

lint_results <- lintr::lint_package(path = path,
Expand Down

0 comments on commit 1066de0

Please sign in to comment.