Closed richelbilderbeek closed 5 years ago
You can find a function to easily create the parameters in mbd.TaxaAndMbness
Add test to see if it can be plugged in easily indeed:
test_that("can plug in mbd.TaxaAndMbness::create_params_table", {
mbd_paramses <- create_mbd_paramses()
for (mbd_params in mbd_paramses) {
expect_silent(check_mbd_params(mbd_params))
}
mbd_paramses <- mbd.TaxaAndMbness::create_params_table()
for (mbd_params in mbd_paramses) {
expect_silent(check_mbd_params(mbd_params))
}
})
Test fails, as create_mbd_paramses
returns a list of mbd_params
, where mbd.TaxaAndMbness::create_params_table()
creates a data frame.
Let's transform the table...
Ah, razzo::create_mbd_params_table
creates a table, looks like a sweet spot :rainbow:
Yup, that is a sweet spot :city_sunrise:
test_that("every row must be unique", {
df <- create_mbd_params_table()
expect_true(is.data.frame(df))
expect_equal(nrow(unique(df)), nrow(df))
expect_true("lambda" %in% names(df))
expect_true("mu" %in% names(df))
expect_true("nu" %in% names(df))
expect_true("q" %in% names(df))
expect_true("crown_age" %in% names(df))
expect_true("seed" %in% names(df))
})
test_that("can plug in mbd.TaxaAndMbness::create_params_table", {
df <- mbd.TaxaAndMbness::create_params_table()
expect_true(is.data.frame(df))
expect_equal(nrow(unique(df)), nrow(df))
expect_true("lambda" %in% names(df))
expect_true("mu" %in% names(df))
expect_true("nu" %in% names(df))
expect_true("q" %in% names(df))
expect_true("crown_age" %in% names(df))
expect_true("seed" %in% names(df))
})
Setup:
7962696 regular 2_create p230198 PD 0:00 1 (Dependency)
7962695 regular 1_instal p230198 R 0:26 1 pg-node013
Install Giappo's new package on razzo_project now:
7962716 regular 2_create p230198 PD 0:00 1 (Dependency)
7962715 regular 1_instal p230198 R 0:14 1 pg-node013
Running... :running_woman:
Will name it 20191014
Done! Will add to overview within some hours....