tests/testthat/test-roxytest-testexamples-sig_estimate.R

# Generated by roxytest: do not edit by hand!

# File R/sig_estimate.R: @testexamples

test_that("Function show_sig_number_survey() @ L267", {
  
  
  load(system.file("extdata", "toy_copynumber_tally_W.RData",
    package = "sigminer", mustWork = TRUE
  ))
  library(NMF)
  cn_estimate <- sig_estimate(cn_tally_W$nmf_matrix,
    cores = 1, nrun = 5,
    verbose = TRUE
  )
  
  p <- show_sig_number_survey2(cn_estimate$survey)
  p
  
  # Show two measures
  show_sig_number_survey(cn_estimate)
  # Show one measure
  p1 <- show_sig_number_survey(cn_estimate, right_y = NULL)
  p1
  p2 <- add_h_arrow(p, x = 4.1, y = 0.953, label = "selected number")
  p2
  
  # Show data from a data.frame
  p3 <- show_sig_number_survey(cn_estimate$survey)
  p3
  # Show other measures
  head(cn_estimate$survey)
  p4 <- show_sig_number_survey(cn_estimate$survey,
    right_y = "dispersion",
    right_name = "dispersion"
  )
  p4
  p5 <- show_sig_number_survey(cn_estimate$survey,
    right_y = "evar",
    right_name = "evar"
  )
  p5
  
  expect_is(p, "ggplot")
  expect_is(p1, "ggplot")
  expect_is(p2, "ggplot")
  expect_is(p3, "ggplot")
  expect_is(p4, "ggplot")
  expect_is(p5, "ggplot")
})
ShixiangWang/sigminer documentation built on March 16, 2024, 12:30 p.m.