Skip to content

Commit

Permalink
Merge conflict resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismainey committed Dec 11, 2019
2 parents a372b15 + 784dadf commit 58b5fb8
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 6 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ cran-comments.md
^pkgdown$
^CRAN-RELEASE$
^README\.Rmd$
testers.R$
6 changes: 3 additions & 3 deletions R/build_limits_lookup.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ build_limits_lookup<-function(min_preds, max_preds, min_ratio, max_ratio, Poisso

# general limits + Tau2 limits table
set.seed(1)
number.seq <- c(seq(0.1, 10, 0.1), seq(11.0, max_preds, 1))
number.seq <- c(seq(0.1, 10.0, 0.1), seq(11.0, as.numeric(max_preds), length.out = 1000))
dfCI <- data.frame(
number.seq,
ll95 = multiplier * ((qchisq(0.975, 2 * number.seq, lower.tail = FALSE) / 2) / number.seq),
Expand All @@ -42,7 +42,7 @@ build_limits_lookup<-function(min_preds, max_preds, min_ratio, max_ratio, Poisso
} else if (method == "SHMI") {
# general limits + Tau2 limits table
set.seed(1)
number.seq <- c(seq(0.1, 10, 0.1), seq(11.0, max_preds, 1))
number.seq <- c(seq(0.1, 10.0, 0.1), seq(11.0, as.numeric(max_preds), length.out = 1000))
dfCI <- data.frame(
number.seq,
ll95 = multiplier * ((qchisq(0.975, 2 * number.seq, lower.tail = FALSE) / 2) / number.seq),
Expand All @@ -56,7 +56,7 @@ build_limits_lookup<-function(min_preds, max_preds, min_ratio, max_ratio, Poisso
)
} else if (method == "CQC") {
set.seed(1)
number.seq <- seq(1, ceiling(as.numeric(max_preds)), 1)
number.seq <- seq(1, ceiling(as.numeric(max_preds)), length.out = 1000)
dfCI <- data.frame(
number.seq,
ll95 = multiplier * ((qchisq(0.975, 2 * number.seq, lower.tail = FALSE) / 2) / number.seq),
Expand Down
2 changes: 1 addition & 1 deletion cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This is a second release of a package wrapper for ggplot2 to draw funnel plots f
There were no ERRORs or WARNINGs.

NOTES on win-builder and r-hub about possibly invalid links.
These refer to DOIs in references in the vignette. I've manually tested all links and they are valid.
These refer to DOIs for references in the vignette. I've manually tested all links and they are valid.

Further note on win-builder and some r-hub builds about a CRAN reference not being in canonical form. This has been changed to use https as suggested.

Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-build_limits_lookup.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ test_that("`build limits funcion` works with input and returns expected data.fra

expect_s3_class(z, "data.frame")
expect_length(z, 9)
expect_length(z$number.seq, 340)
expect_length(z$number.seq, 1100)
#expect_equal(round(b$rr,6), c(1.069652, 1.071795, 1.022727))

})
})
41 changes: 41 additions & 0 deletions testsers.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
a<-2
b<-2

if(a==1 | a==2 & b==1){
print("yes")
} else print("no")


number.seq<-seq(5,50,5)

t <- 0.5

t * ((qchisq(0.975, 2 * number.seq, lower.tail = FALSE) / 2) / number.seq)



funnel_plot(numerator = c(8, 15,18,8,12, 22), denominator= c(12, 21, 26,15,20, 30), OD_adjust=FALSE,
group = factor(c("a","b","c", "d","e","f")), type = "pr", return_elements = "plot")
)



mod_plot<-data.frame(numerator = c(8, 15,18,8,12, 22), denominator= c(12, 21, 26,15,20, 30),
group = factor(c("a","b","c", "d","e","f")))

mod_plot_agg<-aggregate_func(mod_plot)

aggregate_func<- function(mod_plot) {

mod_plot_agg <- mod_plot %>%
dplyr::group_by(.data$group) %>%
dplyr::summarise(
numerator = as.numeric(sum(.data$numerator)),
denominator = as.numeric(sum(.data$denominator)),
ratio = .data$numerator / .data$denominator
)

return(mod_plot_agg)

}

0 comments on commit 58b5fb8

Please sign in to comment.