Nothing
test_that("da_tables() gives the main tables of every analysis", {
g <- Griffing(y = Yield, Rep = Rep, Cross1 = Cross1, Cross2 = Cross2, data = GriffingData1, Method = 1, Model = 1)
tb <- da_tables(g)
expect_type(tb, "list")
expect_true(all(c("Analysis of variance", "General combining ability effects") %in% names(tb)))
expect_true(all(vapply(tb, is.data.frame, logical(1L))))
h <- Hayman(y = Yield, Rep = Rep, Cross1 = Cross1, Cross2 = Cross2, data = HaymanData)
expect_gt(length(da_tables(h)), 1L)
p <- PartialDiallel(y = y, Rep = Rep, Cross1 = Cross1, Cross2 = Cross2, data = PartialDiallelData)
expect_gt(length(da_tables(p)), 1L)
})
test_that("da_export() writes every format", {
g <- Griffing(y = Yield, Rep = Rep, Cross1 = Cross1, Cross2 = Cross2, data = GriffingData2, Method = 2, Model = 1)
dir <- withr::local_tempdir()
tex <- file.path(dir, "g.tex")
da_export(g, file = tex, format = "latex", digits = 2)
txt <- readLines(tex)
expect_true(any(grepl("\\\\toprule", txt)))
expect_true(any(grepl("gca", txt)))
htm <- file.path(dir, "g.html")
da_export(g, file = htm, format = "html")
expect_true(any(grepl("<table", readLines(htm))))
md <- file.path(dir, "g.md")
da_export(g, file = md, format = "markdown")
expect_true(any(grepl("^\\|", readLines(md))))
da_export(g, file = file.path(dir, "g.csv"), format = "csv")
expect_gt(length(list.files(dir, pattern = "\\.csv$")), 1L)
skip_if_not_installed("officer")
skip_if_not_installed("flextable")
doc <- file.path(dir, "g.docx")
da_export(g, file = doc, format = "docx", tables = "Analysis of variance", title = "Table")
expect_gt(file.size(doc), 1000)
})
test_that("da_export() reports unknown tables and wrong objects", {
g <- Griffing(y = Yield, Rep = Rep, Cross1 = Cross1, Cross2 = Cross2, data = GriffingData4, Method = 4, Model = 1)
f <- withr::local_tempfile(fileext = ".tex")
expect_error(da_export(g, file = f, format = "latex", tables = "No such table"), "No such table")
expect_error(da_export(list(), file = f, format = "latex"), "result")
})
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.