Skip to content

Commit 60e3f82

Browse files
committed
Add the package structure
1 parent f35cce0 commit 60e3f82

17 files changed

+756
-35
lines changed

DESCRIPTION

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
Package: PredicTER
2+
Title: Estimates the time required to complete a systematic review or systematic map.
3+
Version: 0.0.0.9000
4+
Authors@R:
5+
c(person(given = "Martin",
6+
family = "Westgate",
7+
email = "[email protected]",
8+
role = "aut"),
9+
person(given = "Matthew",
10+
family = "Grainger",
11+
email = "[email protected]",
12+
role = c("cre")),
13+
person(given = "X",
14+
family = "Y",
15+
email = "",
16+
role = "aut"),
17+
person(given = "Z",
18+
family = "A",
19+
email = "",
20+
role = "aut"))
21+
Description: Uses data from a survey of Review authors to predict the time it takes to complete a Systematic Evidence Synthesis.
22+
License: AGPL (>= 3)
23+
Encoding: UTF-8
24+
Roxygen: list(markdown = TRUE)
25+
RoxygenNote: 7.2.3

LICENSE.md

+659
Large diffs are not rendered by default.

NAMESPACE

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Generated by roxygen2: do not edit by hand
2+
3+
export(runPredicTER)

R/runPredicTER.R

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#' runPredicTER
2+
#'
3+
#' @return launches the PredicTER shiny app
4+
#' @export
5+
#'
6+
#' @examples
7+
#' \dontrun{
8+
#'runPredicTER()
9+
#'}
10+
runPredicTER <- function() {
11+
appDir <- system.file("shiny-examples", "PredicTER", package = "PredicTER")
12+
if (appDir == "") {
13+
stop("Could not find example directory. Try re-installing `PredicTER`.", call. = FALSE)
14+
}
15+
16+
shiny::runApp(appDir, display.mode = "normal")
17+
}

README.md

+10-12
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
PredicTER
22
==========
33

4-
This is a prototype of a shiny app to help users to estimate the time required to complete a systematic review or systematic map.
5-
6-
# Example:
7-
```
8-
# install and load package
9-
library(shiny)
10-
library(shinydashboard)
11-
library(plotly)
12-
library(viridisLite)
13-
runGitHub("PredicTER", "mjwestgate")
14-
15-
```
4+
This an R package including a shiny app to help users to estimate the time required to complete a systematic review or systematic map.
5+
6+
Please see [this paper](https://conbio.onlinelibrary.wiley.com/doi/10.1111/cobi.13231) for more details of the methods used to develop this tool.
7+
8+
## Contributing
9+
10+
11+
## References
12+
13+
Haddaway NR, Westgate MJ. Predicting the time needed for environmental systematic reviews and systematic maps. Conserv Biol. 2019 Apr;33(2):434-443. doi: 10.1111/cobi.13231. Epub 2018 Oct 24. PMID: 30285277.

server.R inst/shiny-examples/PredicTER/server.R

+23-23
Original file line numberDiff line numberDiff line change
@@ -291,13 +291,13 @@ server <- function(input, output, session){
291291
stringsAsFactors = FALSE
292292
)
293293

294-
294+
295295
colnames(lookup_dframe) <- c("row", "stage", "column")
296296
lookup_dframe$value <- unlist(lapply(lookup_names,
297297
function(a){input[[a]]}
298298
))
299299
lookup_dframe<-lookup_dframe[order(lookup_dframe$row, lookup_dframe$column),] # unsorted the df looks like this:
300-
300+
301301
# checked nperday percent
302302
# row2 14.6 10 854
303303
# row3 192 25.0 10
@@ -307,9 +307,9 @@ server <- function(input, output, session){
307307
# row7 11.7 0 76.0
308308
# row8 100.0 0 6.9
309309
# row9 59.2 24 0
310-
310+
311311
#sorted the daf looks like this:
312-
312+
313313
# checked nperday percent
314314
# row2 10 854 14.6
315315
# row3 10 192 25.0
@@ -319,33 +319,33 @@ server <- function(input, output, session){
319319
# row7 0 11.7 76.0
320320
# row8 0 6.9 100.0
321321
# row9 0 24 59.2
322-
323-
324322

325-
326-
# convert to data.frame
323+
324+
325+
326+
# convert to data.frame
327327
count_dframe <- as.data.frame(
328328
do.call(rbind, split(lookup_dframe[, "value"], lookup_dframe$row)),
329329
stringsAsFactors = FALSE
330330
)
331331

332-
332+
333333
colnames(count_dframe) <- c("checked", "nperday", "percent")
334334
initial_dframe <- data.frame(
335335
checked = c(0),
336336
nperday = c(1),
337337
percent = safe_numeric(input$unique_percent)
338338
)
339-
339+
340340
count_dframe <- as.data.frame(
341341
rbind(initial_dframe, count_dframe),
342342
stringsAsFactors=FALSE
343343
)
344344
count_dframe$checked <- 1 + (as.numeric(count_dframe$checked) * 0.01)
345345
count_dframe$nperday <- as.numeric(count_dframe$nperday)
346346
count_dframe$percent <- as.numeric(count_dframe$percent) * 0.01
347-
348-
347+
348+
349349

350350
# calculate number of articles, and time taken to process them
351351
count_dframe$cumulative_percent <- cumprod(count_dframe$percent)
@@ -469,8 +469,8 @@ server <- function(input, output, session){
469469
labels = rev(as.character(time_dframe$y))
470470
)
471471
}
472-
473-
472+
473+
474474

475475
# save a 'clean' version for user
476476
time_dframe_clean <- time_dframe[, c("stage", "group_factor", "value")]
@@ -655,7 +655,7 @@ server <- function(input, output, session){
655655
observeEvent(input$help_review_type, {
656656
shiny::showModal(
657657
shiny::modalDialog(
658-
includeHTML("0_review_type_help_text.txt"),
658+
includeHTML("www/0_review_type_help_text.txt"),
659659
title = "Review Type",
660660
footer = shiny::modalButton(
661661
label = "OK",
@@ -669,7 +669,7 @@ server <- function(input, output, session){
669669
observeEvent(input$help_planning, {
670670
shiny::showModal(
671671
shiny::modalDialog(
672-
includeHTML("1_planning_help_text.txt"),
672+
includeHTML("www/1_planning_help_text.txt"),
673673
title = "Planning",
674674
footer = shiny::modalButton(
675675
label = "OK",
@@ -683,7 +683,7 @@ server <- function(input, output, session){
683683
observeEvent(input$help_searching, {
684684
shiny::showModal(
685685
shiny::modalDialog(
686-
includeHTML("2_searching_help_text.txt"),
686+
includeHTML("www/2_searching_help_text.txt"),
687687
title = "Searching",
688688
footer = shiny::modalButton(
689689
label = "OK",
@@ -697,7 +697,7 @@ server <- function(input, output, session){
697697
observeEvent(input$help_screening, {
698698
shiny::showModal(
699699
shiny::modalDialog(
700-
includeHTML("3_screening_help_text.txt"),
700+
includeHTML("www/3_screening_help_text.txt"),
701701
title = "Screening",
702702
footer = shiny::modalButton(
703703
label = "OK",
@@ -710,9 +710,9 @@ server <- function(input, output, session){
710710

711711
observeEvent(input$help_deas, {
712712
if(any(input$tabs == "syst_review")){
713-
deas_help <- "4_DEAS_SR_help_text.txt"
713+
deas_help <- "www/4_DEAS_SR_help_text.txt"
714714
}else{
715-
deas_help <- "4_DEAS_SM_help_text.txt"
715+
deas_help <- "www/4_DEAS_SM_help_text.txt"
716716
}
717717
shiny::showModal(
718718
shiny::modalDialog(
@@ -730,7 +730,7 @@ server <- function(input, output, session){
730730
observeEvent(input$help_reporting, {
731731
shiny::showModal(
732732
shiny::modalDialog(
733-
includeHTML("5_reporting_help_text.txt"),
733+
includeHTML("www/5_reporting_help_text.txt"),
734734
title = "Reporting",
735735
footer = shiny::modalButton(
736736
label = "OK",
@@ -744,7 +744,7 @@ server <- function(input, output, session){
744744
observeEvent(input$about, {
745745
shiny::showModal(
746746
shiny::modalDialog(
747-
includeHTML("6_about_PredicTER.txt"),
747+
includeHTML("www/6_about_PredicTER.txt"),
748748
title = "PredicTER",
749749
footer = shiny::modalButton(
750750
label = "OK",
@@ -755,4 +755,4 @@ server <- function(input, output, session){
755755
)
756756
})
757757

758-
}
758+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.

man/runPredicTER.Rd

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)