Skip to content

Commit

Permalink
ggplot2
Browse files Browse the repository at this point in the history
  • Loading branch information
FBartos committed Jan 13, 2023
1 parent 1708a14 commit 485ca77
Show file tree
Hide file tree
Showing 13 changed files with 890 additions and 74 deletions.
6 changes: 4 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: zcurve
Title: An Implementation of Z-Curves
Version: 2.3.0
Version: 2.4.0
Authors@R: c(
person("František", "Bartoš", email = "[email protected]", role = c("aut", "cre")),
person("Ulrich", "Schimmack", email = "[email protected]", role = c("aut")))
Expand All @@ -24,7 +24,9 @@ Imports:
stats,
evmix,
graphics,
Rdpack
ggplot2,
Rdpack,
rlang
LinkingTo: Rcpp
Suggests:
parallel,
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,6 @@ export(zcurve_clustered)
export(zcurve_data)
importFrom(Rcpp,sourceCpp)
importFrom(Rdpack,reprompt)
importFrom(rlang,.data)
importFrom(utils,head)
useDynLib(zcurve, .registration = TRUE)
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## version 2.4.0
- Implementation of ggploting function.

## version 2.3.0
- Implementation of parallel bootstrap.

Expand Down
354 changes: 283 additions & 71 deletions R/main.R

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions R/zcurve-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
#' @useDynLib zcurve, .registration = TRUE
#' @importFrom Rcpp sourceCpp
#' @importFrom Rdpack reprompt
#' @importFrom rlang .data
## usethis namespace: end
NULL
5 changes: 5 additions & 0 deletions man/plot.zcurve.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

89 changes: 89 additions & 0 deletions tests/testthat/_snaps/zcurve/z-curve-cens-em-ggplot.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
100 changes: 100 additions & 0 deletions tests/testthat/_snaps/zcurve/z-curve-clustered-mixed-ggplot-1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
100 changes: 100 additions & 0 deletions tests/testthat/_snaps/zcurve/z-curve-clustered-mixed-ggplot-2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
108 changes: 108 additions & 0 deletions tests/testthat/_snaps/zcurve/z-curve-em-ggplot.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
99 changes: 99 additions & 0 deletions tests/testthat/_snaps/zcurve/z-curve-kd2-ggplot.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
89 changes: 89 additions & 0 deletions tests/testthat/_snaps/zcurve/z-curve-mixed-em-ggplot.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 8 additions & 1 deletion tests/testthat/test-zcurve.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ test_that("z-curve EM can be fitted and reproduces OSC results", {

# plot
expect_doppelganger("z-curve EM", function()plot(fit.EM, main = "OSC (with EM)", annotation = TRUE, CI = TRUE))
expect_doppelganger("z-curve EM (ggplot)", suppressWarnings(plot(fit.EM, main = "OSC (with EM)", annotation = TRUE, CI = TRUE, plot_type = "ggplot")))

})
test_that("z-curve KD2 can be fitted and reproduces OSC results", {
Expand Down Expand Up @@ -100,6 +101,7 @@ test_that("z-curve KD2 can be fitted and reproduces OSC results", {

# plot
expect_doppelganger("z-curve KD2", function()plot(fit.KD2))
expect_doppelganger("z-curve KD2 (ggplot)", plot(fit.KD2, plot_type = "ggplot"))

})
test_that("z-curve EM censoring works", {
Expand Down Expand Up @@ -131,6 +133,7 @@ test_that("z-curve EM censoring works", {

# plot
expect_doppelganger("z-curve mixed EM", function()plot(fit.mixed, CI = TRUE))
expect_doppelganger("z-curve mixed EM (ggplot)", plot(fit.mixed, CI = TRUE, plot_type = "ggplot"))


# censoring only
Expand All @@ -155,6 +158,7 @@ test_that("z-curve EM censoring works", {

# plot
expect_doppelganger("z-curve cens EM", function()plot(fit.cens, CI = TRUE))
expect_doppelganger("z-curve cens EM (ggplot)", plot(fit.cens, CI = TRUE, plot_type = "ggplot"))
})
test_that("z-curve clustered works", {

Expand Down Expand Up @@ -208,7 +212,7 @@ test_that("z-curve clustered works", {
plot(fitw)
})


# precise
data <- paste0("z = ",z)
data <- zcurve_data(data, id)
Expand Down Expand Up @@ -301,4 +305,7 @@ test_that("z-curve clustered works", {
plot(fitb)
plot(fitw)
})

expect_doppelganger("z-curve clustered mixed (ggplot-1)", plot(fitb, plot_type = "ggplot"))
expect_doppelganger("z-curve clustered mixed (ggplot-2)", plot(fitw, plot_type = "ggplot"))
})

0 comments on commit 485ca77

Please sign in to comment.