richelbilderbeek / razzo

Research project by Giovanni Laudanno and Richel J.C. Bilderbeek
GNU General Public License v3.0
2 stars 2 forks source link

[CREATE FIGURES] Do Giappo run #336

Closed richelbilderbeek closed 5 years ago

richelbilderbeek commented 5 years ago
         la mu  nu     q        age cond
1     0.2 0.0 0.0 0.00         8    1
2     0.2 0.1 0.0 0.00         8    1
3     0.2 0.0 0.5 0.10         8    1
4     0.2 0.1 0.5 0.10         8    1
5     0.2 0.0 1.0 0.10         8    1
6     0.2 0.1 1.0 0.10         8    1
7     0.2 0.0 1.5 0.10         8    1
8     0.2 0.1 1.5 0.10         8    1
9     0.2 0.0 0.5 0.15         8    1
10    0.2 0.1 0.5 0.15         8    1
11    0.2 0.0 1.0 0.15         8    1
12    0.2 0.1 1.0 0.15         8    1
13    0.2 0.0 1.5 0.15         8    1
14    0.2 0.1 1.5 0.15         8    1
15    0.2 0.0 0.5 0.20         8    1
16    0.2 0.1 0.5 0.20         8    1
17    0.2 0.0 1.0 0.20         8    1
18    0.2 0.1 1.0 0.20         8    1
19    0.2 0.0 1.5 0.20         8    1
20    0.2 0.1 1.5 0.20         8    1
richelbilderbeek commented 5 years ago

You can find a function to easily create the parameters in mbd.TaxaAndMbness

richelbilderbeek commented 5 years ago

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))
  }
})
richelbilderbeek commented 5 years ago

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...

richelbilderbeek commented 5 years ago

Ah, razzo::create_mbd_params_table creates a table, looks like a sweet spot :rainbow:

richelbilderbeek commented 5 years ago

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))
})
richelbilderbeek commented 5 years ago

Setup:

     7962696   regular 2_create  p230198 PD       0:00      1 (Dependency)
           7962695   regular 1_instal  p230198  R       0:26      1 pg-node013
richelbilderbeek commented 5 years ago

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
richelbilderbeek commented 5 years ago

Running... :running_woman:

richelbilderbeek commented 5 years ago

Will name it 20191014

richelbilderbeek commented 5 years ago

Done! Will add to overview within some hours....