[R/default_params_doc.R:176:3:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/default_params_doc.R#L176) *style:* **Variable or function name should be snake_case.**
```r
  N,
  ^
```
[R/default_params_doc.R:188:3:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/default_params_doc.R#L188) *style:* **Variable or function name should be snake_case.**
```r
  Q,
  ^
```
[R/mbd_loglik_choosepar.R:23:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_choosepar.R#L23) *style:* **Lines should not be more than 80 characters.**
```r
  #This function provides a likelihood for a subset of parameters. This is built to work inside mbd_minusLL_vs_single_parameter or any optimizer like simplex, optim or subplex
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_choosepar.R:43:23:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_choosepar.R#L43) *style:* **Put spaces around all infix operators.**
```r
      pars1 <- trpars1/(1 - trpars1)
                     ~^~
```
[R/mbd_loglik_choosepar.R:43:24:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_choosepar.R#L43) *style:* **Place a space before left parenthesis, except in a function call.**
```r
      pars1 <- trpars1/(1 - trpars1)
                       ^
```
[R/mbd_loglik_choosepar.R:60:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_choosepar.R#L60) *style:* **Lines should not be more than 80 characters.**
```r
    cat("There are parameter values used which cause numerical problems:", trpars1, "\n")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:5:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L5) *style:* **Lines should not be more than 80 characters.**
```r
hyperA_HannoX <- function(N, k, q) {# HG function: fast O(N), updated after Moulis meeting
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:5:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L5) *style:* **Variable or function name should be snake_case.**
```r
hyperA_HannoX <- function(N, k, q) {# HG function: fast O(N), updated after Moulis meeting
^~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:5:27:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L5) *style:* **Variable or function name should be snake_case.**
```r
hyperA_HannoX <- function(N, k, q) {# HG function: fast O(N), updated after Moulis meeting
                          ^
```
[R/mbd_loglik_utils.R:5:36:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L5) *style:* **Opening curly braces should never go on their own line and should always be followed by a new line.**
```r
hyperA_HannoX <- function(N, k, q) {# HG function: fast O(N), updated after Moulis meeting
                                   ^
```
[R/mbd_loglik_utils.R:7:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L7) *style:* **Lines should not be more than 80 characters.**
```r
  #it produces the structure q^(m-n)*(1-q)^(k+2*n-m)*sum_j 2^j choose(k, j)*choose(n, m-n-j)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:9:3:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L9) *style:* **Variable or function name should be snake_case.**
```r
  A1 <- (1 - q) ^ (k) * choose(k, j) * (2)^j
  ^~
```
[R/mbd_loglik_utils.R:10:3:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L10) *style:* **Variable or function name should be snake_case.**
```r
  N <- N + 1
  ^
```
[R/mbd_loglik_utils.R:11:3:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L11) *style:* **Variable or function name should be snake_case.**
```r
  A <- diag(A1[1], nrow = N + 2, ncol = N + 2)
  ^
```
[R/mbd_loglik_utils.R:12:15:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L12) *style:* **Commas should always have a space after.**
```r
  A[1:(k + 1),1] <- A1
              ^
```
[R/mbd_loglik_utils.R:18:41:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L18) *style:* **Put spaces around all infix operators.**
```r
    A[s, src] <- A[s, src] * q ^ (m - n)*(1 - q)^(2 * n - m)
                                       ~^~
```
[R/mbd_loglik_utils.R:18:42:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L18) *style:* **Place a space before left parenthesis, except in a function call.**
```r
    A[s, src] <- A[s, src] * q ^ (m - n)*(1 - q)^(2 * n - m)
                                         ^
```
[R/mbd_loglik_utils.R:18:50:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L18) *style:* **Place a space before left parenthesis, except in a function call.**
```r
    A[s, src] <- A[s, src] * q ^ (m - n)*(1 - q)^(2 * n - m)
                                                 ^
```
[R/mbd_loglik_utils.R:20:11:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L20) *style:* **Use <-, not =, for assignment.**
```r
  A[N, N] = A[N, N] * (1 - q) ^ (N - 1);
          ^
```
[R/mbd_loglik_utils.R:24:3:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L24) *style:* **Commented code should be removed.**
```r
# if (.Platform$OS.type=="windows"){matrix_builder = hyperA:::hyperA}
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:25:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L25) *style:* **Lines should not be more than 80 characters.**
```r
# if (.Platform$OS.type=="unix")   {matrix_builder = hyperA_HannoX} #this is set to work with home directory of the cluster
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:25:3:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L25) *style:* **Commented code should be removed.**
```r
# if (.Platform$OS.type=="unix")   {matrix_builder = hyperA_HannoX} #this is set to work with home directory of the cluster
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:31:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L31) *style:* **Lines should not be more than 80 characters.**
```r
create_A0 <- function(max_number_of_species, lambda, mu, q, k, matrix_builder = hyperA_HannoX){
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:31:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L31) *style:* **Variable or function name should be snake_case.**
```r
create_A0 <- function(max_number_of_species, lambda, mu, q, k, matrix_builder = hyperA_HannoX){
^~~~~~~~~
```
[R/mbd_loglik_utils.R:32:8:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L32) *style:* **Use <-, not =, for assignment.**
```r
  nvec = 0:max_number_of_species
       ^
```
[R/mbd_loglik_utils.R:33:3:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L33) *style:* **Variable or function name should be snake_case.**
```r
  M = lambda * matrix_builder(N = max_number_of_species, k = k, q = q)
  ^
```
[R/mbd_loglik_utils.R:33:5:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L33) *style:* **Use <-, not =, for assignment.**
```r
  M = lambda * matrix_builder(N = max_number_of_species, k = k, q = q)
    ^
```
[R/mbd_loglik_utils.R:35:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L35) *style:* **Lines should not be more than 80 characters.**
```r
  # diag(M) = (-lambda)*c( (1-(1-q)^(k+( nvec[1:max_number_of_species] ) )),0 ) - mu*(nvec+k)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:35:5:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L35) *style:* **Commented code should be removed.**
```r
  # diag(M) = (-lambda)*c( (1-(1-q)^(k+( nvec[1:max_number_of_species] ) )),0 ) - mu*(nvec+k)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:36:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L36) *style:* **Lines should not be more than 80 characters.**
```r
  diag(M) = (-lambda) * ( 1 - (1 - q)^(k + nvec) ) - mu * (nvec + k) #new version to avoid the dumpster problem at the end of the matrix
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:36:11:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L36) *style:* **Use <-, not =, for assignment.**
```r
  diag(M) = (-lambda) * ( 1 - (1 - q)^(k + nvec) ) - mu * (nvec + k) #new version to avoid the dumpster problem at the end of the matrix
          ^
```
[R/mbd_loglik_utils.R:36:26:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L36) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
  diag(M) = (-lambda) * ( 1 - (1 - q)^(k + nvec) ) - mu * (nvec + k) #new version to avoid the dumpster problem at the end of the matrix
                         ^
```
[R/mbd_loglik_utils.R:36:39:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L36) *style:* **Place a space before left parenthesis, except in a function call.**
```r
  diag(M) = (-lambda) * ( 1 - (1 - q)^(k + nvec) ) - mu * (nvec + k) #new version to avoid the dumpster problem at the end of the matrix
                                      ^
```
[R/mbd_loglik_utils.R:36:49:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L36) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
  diag(M) = (-lambda) * ( 1 - (1 - q)^(k + nvec) ) - mu * (nvec + k) #new version to avoid the dumpster problem at the end of the matrix
                                                ^
```
[R/mbd_loglik_utils.R:38:27:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L38) *style:* **Use <-, not =, for assignment.**
```r
  M[row(M) == col(M) - 1] = mu * nvec[2:(max_number_of_species + 1)]
                          ^
```
[R/mbd_loglik_utils.R:46:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L46) *style:* **Lines should not be more than 80 characters.**
```r
create_B0 <- function(max_number_of_species, q, k, b, matrix_builder = hyperA_HannoX){#lambda * choose(k, b) * q^b  is going to be added in logB in the main script
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:46:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L46) *style:* **Variable or function name should be snake_case.**
```r
create_B0 <- function(max_number_of_species, q, k, b, matrix_builder = hyperA_HannoX){#lambda * choose(k, b) * q^b  is going to be added in logB in the main script
^~~~~~~~~
```
[R/mbd_loglik_utils.R:46:86:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L46) *style:* **Opening curly braces should never go on their own line and should always be followed by a new line.**
```r
create_B0 <- function(max_number_of_species, q, k, b, matrix_builder = hyperA_HannoX){#lambda * choose(k, b) * q^b  is going to be added in logB in the main script
                                                                                ^
```
[R/mbd_loglik_utils.R:48:3:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L48) *style:* **Variable or function name should be snake_case.**
```r
  B <- matrix_builder(N = max_number_of_species, k = k2, q = q)
  ^
```
[R/mbd_loglik_utils.R:57:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L57) *style:* **Variable or function name should be snake_case.**
```r
create_A <- function(lambda, mu, nu, q, k, max_number_of_species){
^~~~~~~~
```
[R/mbd_loglik_utils.R:61:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L61) *style:* **Lines should not be more than 80 characters.**
```r
  m[row(m) == col(m) + 1] <- m[row(m) == col(m) + 1] + lambda * (nvec[1:(max_number_of_species)]+2*k)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:61:97:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L61) *style:* **Put spaces around all infix operators.**
```r
  m[row(m) == col(m) + 1] <- m[row(m) == col(m) + 1] + lambda * (nvec[1:(max_number_of_species)]+2*k)
                                                                                ~^~
```
[R/mbd_loglik_utils.R:61:99:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L61) *style:* **Put spaces around all infix operators.**
```r
  m[row(m) == col(m) + 1] <- m[row(m) == col(m) + 1] + lambda * (nvec[1:(max_number_of_species)]+2*k)
                                                                                ~^~
```
[R/mbd_loglik_utils.R:63:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L63) *style:* **Lines should not be more than 80 characters.**
```r
  # m[row(m) == col(m)] = m[row(m) == col(m)] - c(lambda*(nvec[-length(nvec)]+k),0)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:63:5:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L63) *style:* **Commented code should be removed.**
```r
  # m[row(m) == col(m)] = m[row(m) == col(m)] - c(lambda*(nvec[-length(nvec)]+k),0)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:64:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L64) *style:* **Lines should not be more than 80 characters.**
```r
  m[row(m) == col(m)] <- m[row(m) == col(m)] - lambda * (nvec + k) #new version to avoid the dumpster problem at the end of the matrix
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:74:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L74) *style:* **Variable or function name should be snake_case.**
```r
create_B <- function(lambda, nu, q, k, b, max_number_of_species){
^~~~~~~~
```
[R/mbd_loglik_utils.R:75:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L75) *style:* **Lines should not be more than 80 characters.**
```r
  m <- create_B0(max_number_of_species = max_number_of_species, q = q, k = k, b = b)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:75:8:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L75) *warning:* **no visible global function definition for ‘create_B0’**
```r
  m <- create_B0(max_number_of_species = max_number_of_species, q = q, k = k, b = b)
       ^~~~~~~~~
```
[R/mbd_loglik_utils.R:76:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L76) *style:* **Lines should not be more than 80 characters.**
```r
  lambda * k * diag(max_number_of_species + 1) * (b == 1) + nu * choose(k, b) * (q^b) * m
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:84:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L84) *style:* **Variable or function name should be snake_case.**
```r
create_A.no_mbd = function(
^~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:84:17:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L84) *style:* **Use <-, not =, for assignment.**
```r
create_A.no_mbd = function(
                ^
```
[R/mbd_loglik_utils.R:95:51:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L95) *style:* **Trailing whitespace is superfluous.**
```r
    max_number_of_species = max_number_of_species,
                                                  ^
```
[R/mbd_loglik_utils.R:98:64:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L98) *style:* **Trailing whitespace is superfluous.**
```r
  m[row(m) == col(m) + 1] <- m[row(m) == col(m) + 1] + lambda *
                                                               ^
```
[R/mbd_loglik_utils.R:100:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L100) *style:* **Lines should not be more than 80 characters.**
```r
  m[row(m) == col(m)]     <- m[row(m) == col(m)] - c(lambda * (nvec[-length(nvec)] + k), 0)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:110:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L110) *style:* **Variable or function name should be snake_case.**
```r
create_B.no_mbd = function(
^~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:110:17:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L110) *style:* **Use <-, not =, for assignment.**
```r
create_B.no_mbd = function(
                ^
```
[R/mbd_loglik_utils.R:111:10:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L111) *style:* **Trailing whitespace is superfluous.**
```r
  lambda,
         ^
```
[R/mbd_loglik_utils.R:112:6:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L112) *style:* **Trailing whitespace is superfluous.**
```r
  nu,
     ^
```
[R/mbd_loglik_utils.R:113:5:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L113) *style:* **Trailing whitespace is superfluous.**
```r
  q,
    ^
```
[R/mbd_loglik_utils.R:114:5:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L114) *style:* **Trailing whitespace is superfluous.**
```r
  k,
    ^
```
[R/mbd_loglik_utils.R:115:5:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L115) *style:* **Trailing whitespace is superfluous.**
```r
  b,
    ^
```
[R/mbd_loglik_utils.R:116:25:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L116) *style:* **Trailing whitespace is superfluous.**
```r
  max_number_of_species,
                        ^
```
[R/mbd_loglik_utils.R:121:3:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L121) *style:* **Variable or function name should be snake_case.**
```r
  B <- lambda * k * diag(max_number_of_species + 1) *
  ^
```
[R/mbd_loglik_utils.R:121:54:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L121) *style:* **Trailing whitespace is superfluous.**
```r
  B <- lambda * k * diag(max_number_of_species + 1) *
                                                     ^
```
[R/mbd_loglik_utils.R:132:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L132) *style:* **Variable or function name should be snake_case.**
```r
A_operator <- function(
^~~~~~~~~~
```
[R/mbd_loglik_utils.R:133:3:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L133) *style:* **Variable or function name should be snake_case.**
```r
  Q,
  ^
```
[R/mbd_loglik_utils.R:133:5:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L133) *style:* **Trailing whitespace is superfluous.**
```r
  Q,
    ^
```
[R/mbd_loglik_utils.R:134:21:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L134) *style:* **Trailing whitespace is superfluous.**
```r
  transition_matrix,
                    ^
```
[R/mbd_loglik_utils.R:135:17:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L135) *style:* **Trailing whitespace is superfluous.**
```r
  time_interval,
                ^
```
[R/mbd_loglik_utils.R:137:20:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L137) *style:* **Trailing whitespace is superfluous.**
```r
  a_abstol = 1e-16,
                   ^
```
[R/mbd_loglik_utils.R:138:20:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L138) *style:* **Trailing whitespace is superfluous.**
```r
  a_reltol = 1e-10,
                   ^
```
[R/mbd_loglik_utils.R:150:7:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L150) *style:* **Commented code should be removed.**
```r
    # exp_matrix <- rsexpm:::sexpm(transition_matrix * time_interval)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:151:7:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L151) *style:* **Commented code should be removed.**
```r
    # result     <- exp_matrix %*% Q
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:155:5:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L155) *style:* **Variable or function name should be snake_case.**
```r
    result.nan <- result.negative <- 1
    ^~~~~~~~~~
```
[R/mbd_loglik_utils.R:155:19:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L155) *style:* **Variable or function name should be snake_case.**
```r
    result.nan <- result.negative <- 1
                  ^~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:157:28:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L157) *style:* **Put spaces around all infix operators.**
```r
    while ((result.nan == 1| result.negative == 1) &
                          ~^
```
[R/mbd_loglik_utils.R:157:53:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L157) *style:* **Trailing whitespace is superfluous.**
```r
    while ((result.nan == 1| result.negative == 1) &
                                                    ^
```
[R/mbd_loglik_utils.R:159:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L159) *style:* **Lines should not be more than 80 characters.**
```r
      result <- try(expoRkit::expv(v = Q, x = transition_matrix, t = time_interval, m = precision), silent = TRUE)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:161:7:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L161) *style:* **Variable or function name should be snake_case.**
```r
      result.nan <- (any(!is.numeric(result)) || any(is.nan(result)))
      ^~~~~~~~~~
```
[R/mbd_loglik_utils.R:165:9:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L165) *style:* **Variable or function name should be snake_case.**
```r
        result.negative <- (any(result < 0))
        ^~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:185:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L185) *style:* **Lines should not be more than 80 characters.**
```r
    R.utils::withTimeout(result <- deSolve::ode(y = Q, times = times, func = mbd_loglik_rhs, parms = ode_matrix, atol = a_abstol, rtol = a_reltol)[2,-1], timeout = 1001)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:185:78:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L185) *warning:* **no visible binding for global variable ‘mbd_loglik_rhs’**
```r
    R.utils::withTimeout(result <- deSolve::ode(y = Q, times = times, func = mbd_loglik_rhs, parms = ode_matrix, atol = a_abstol, rtol = a_reltol)[2,-1], timeout = 1001)
                                                                             ^~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:185:150:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L185) *style:* **Commas should always have a space after.**
```r
    R.utils::withTimeout(result <- deSolve::ode(y = Q, times = times, func = mbd_loglik_rhs, parms = ode_matrix, atol = a_abstol, rtol = a_reltol)[2,-1], timeout = 1001)
                                                                                ^
```
[R/mbd_loglik_utils.R:195:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L195) *style:* **Lines should not be more than 80 characters.**
```r
#' A_operator_old <- function(Q, transition_matrix, time_interval, precision = 50L,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:206:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L206) *style:* **Lines should not be more than 80 characters.**
```r
#'     result <- try(expoRkit::expv(v = Q, x = transition_matrix, t = time_interval, m = precision), silent = T)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:207:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L207) *style:* **Lines should not be more than 80 characters.**
```r
#'     while ( ( any(!is.numeric(result)) || any(is.nan(result)) ) && precision < precision_limit )
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:210:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L210) *style:* **Lines should not be more than 80 characters.**
```r
#'       result <- try(expoRkit::expv(v = Q, x = transition_matrix, t = time_interval, m = precision), silent = T)}
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:216:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L216) *style:* **Lines should not be more than 80 characters.**
```r
#'         result <- try(expoRkit::expv(v = Q, x = transition_matrix, t = time_interval, m = precision), silent = T)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:223:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L223) *style:* **Lines should not be more than 80 characters.**
```r
#'     # result<-deSolve::ode(y = Q, times = times, func = mbd_loglik_rhs, parms = ode_matrix, atol=a_abstol, rtol=a_reltol)[2,-1]
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:224:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L224) *style:* **Lines should not be more than 80 characters.**
```r
#'     R.utils::withTimeout(result <- deSolve::ode(y = Q, times = times, func = mbd_loglik_rhs, parms = ode_matrix, atol=a_abstol, rtol=a_reltol)[2,-1], timeout = 1000)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:227:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L227) *style:* **Lines should not be more than 80 characters.**
```r
#'   if (any(!is.numeric(result)) || any(is.nan(result))) #sometimes expoRkit gives weird negative values. In this case perform standard lsoda integration.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:231:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L231) *style:* **Lines should not be more than 80 characters.**
```r
#'     # result<-deSolve::ode(y = Q, times = times, func = mbd_loglik_rhs, parms = ode_matrix, atol=a_abstol, rtol=a_reltol)[2,-1]
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:232:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L232) *style:* **Lines should not be more than 80 characters.**
```r
#'     R.utils::withTimeout(result <- deSolve::ode(y = Q, times = times, func = mbd_loglik_rhs, parms = ode_matrix, atol=a_abstol, rtol=a_reltol)[2,-1], timeout = 1000)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:234:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L234) *style:* **Lines should not be more than 80 characters.**
```r
#'   else if (any(result < 0)) #sometimes expoRkit gives weird negative values. In this case perform standard lsoda integration.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:238:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L238) *style:* **Lines should not be more than 80 characters.**
```r
#'     # result=deSolve::ode(y = Q, times = times, func = mbd_loglik_rhs, parms = ode_matrix, atol=a_abstol, rtol=a_reltol)[2,-1]
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:239:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L239) *style:* **Lines should not be more than 80 characters.**
```r
#'     R.utils::withTimeout(result <- deSolve::ode(y = Q, times = times, func = mbd_loglik_rhs, parms = ode_matrix, atol=a_abstol, rtol=a_reltol)[2,-1], timeout = 1000)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:242:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L242) *style:* **Lines should not be more than 80 characters.**
```r
#'   # if ( ( any(!is.numeric(result)) || any(is.nan(result)) ) && methode!="sexpm"){
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:243:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L243) *style:* **Lines should not be more than 80 characters.**
```r
#'   #     # to run this you actually need sexpm to be installed which, on the cluster, might not be the case.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:257:5:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L257) *style:* **Trailing whitespace is superfluous.**
```r
  t,
    ^
```
[R/mbd_loglik_utils.R:258:5:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L258) *style:* **Trailing whitespace is superfluous.**
```r
  x,
    ^
```
[R/mbd_loglik_utils.R:263:21:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L263) *style:* **Use <-, not =, for assignment.**
```r
    starting_vector = x
                    ^
```
[R/mbd_loglik_utils.R:264:23:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L264) *style:* **Use <-, not =, for assignment.**
```r
    transition_matrix = pars
                      ^
```
[R/mbd_loglik_utils.R:265:9:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L265) *style:* **Use <-, not =, for assignment.**
```r
    dx  = rep(0, length(starting_vector))
        ^
```
[R/mbd_loglik_utils.R:266:9:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L266) *style:* **Use <-, not =, for assignment.**
```r
    dx  = drop(transition_matrix %*% starting_vector)
        ^
```
[R/mbd_loglik_utils.R:267:9:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L267) *style:* **Use <-, not =, for assignment.**
```r
    out = (dx)
        ^
```
[R/mbd_loglik_utils.R:268:16:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L268) *style:* **Use <-, not =, for assignment.**
```r
    names(out) = names(x)
               ^
```
[R/mbd_loglik_utils.R:279:8:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L279) *style:* **Trailing whitespace is superfluous.**
```r
  pars,
       ^
```
[R/mbd_loglik_utils.R:280:8:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L280) *style:* **Trailing whitespace is superfluous.**
```r
  brts,
       ^
```
[R/mbd_loglik_utils.R:281:6:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L281) *style:* **Trailing whitespace is superfluous.**
```r
  lx,
     ^
```
[R/mbd_loglik_utils.R:282:7:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L282) *style:* **Trailing whitespace is superfluous.**
```r
  soc,
      ^
```
[R/mbd_loglik_utils.R:283:11:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L283) *style:* **Trailing whitespace is superfluous.**
```r
  methode,
          ^
```
[R/mbd_loglik_utils.R:284:18:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L284) *style:* **Trailing whitespace is superfluous.**
```r
  abstol = 1e-16,
                 ^
```
[R/mbd_loglik_utils.R:287:22:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L287) *warning:* **local variable ‘mu’ assigned but may not be used**
```r
  lambda <- pars[1]; mu <- pars[2]; nu <- pars[3]; q <- pars[4]
                     ^~
```
[R/mbd_loglik_utils.R:289:3:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L289) *style:* **Variable or function name should be snake_case.**
```r
  Qi <- c(1, rep(0, lx))
  ^~
```
[R/mbd_loglik_utils.R:291:3:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L291) *style:* **Variable or function name should be snake_case.**
```r
  T0 <- create_A(lambda = lambda, mu = 0, nu = nu, q = q, k = soc,
  ^~
```
[R/mbd_loglik_utils.R:292:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L292) *style:* **Lines should not be more than 80 characters.**
```r
                       max_number_of_species = lx); #dim(TM); max(is.na(TM)); max(is.infinite(TM))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:292:54:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L292) *style:* **Commented code should be removed.**
```r
                       max_number_of_species = lx); #dim(TM); max(is.na(TM)); max(is.infinite(TM))
                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:293:3:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L293) *style:* **Variable or function name should be snake_case.**
```r
  Pm <- A_operator(Q = Qi, transition_matrix = T0, time_interval = total_time,
  ^~
```
[R/mbd_loglik_utils.R:294:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L294) *style:* **Lines should not be more than 80 characters.**
```r
                         precision = 250L, methode = methode, a_abstol = abstol, a_reltol = reltol)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:295:5:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L295) *style:* **Commented code should be removed.**
```r
  # graphics::plot((Pm/sum(Pm)))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:296:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L296) *style:* **Lines should not be more than 80 characters.**
```r
  k_limit <- soc + max(mvec[(mvec %in% which((cumsum(Pm/sum(Pm))) <= 0.95))]); k_limit
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:296:56:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L296) *style:* **Put spaces around all infix operators.**
```r
  k_limit <- soc + max(mvec[(mvec %in% which((cumsum(Pm/sum(Pm))) <= 0.95))]); k_limit
                                                      ~^~
```
[R/mbd_loglik_utils.R:305:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L305) *style:* **Variable and function names should not be longer than 30 characters.**
```r
calculate_conditional_probability <- function(
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:311:13:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L311) *style:* **Only use double-quotes.**
```r
  methode = 'expo',
            ^~~~~~
```
[R/mbd_loglik_utils.R:319:3:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L319) *style:* **Variable or function name should be snake_case.**
```r
  one_over_Cm <- (3 * (m + 1))/(m + 3); length(one_over_Cm)
  ^~~~~~~~~~~
```
[R/mbd_loglik_utils.R:319:31:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L319) *style:* **Put spaces around all infix operators.**
```r
  one_over_Cm <- (3 * (m + 1))/(m + 3); length(one_over_Cm)
                             ~^~
```
[R/mbd_loglik_utils.R:319:32:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L319) *style:* **Place a space before left parenthesis, except in a function call.**
```r
  one_over_Cm <- (3 * (m + 1))/(m + 3); length(one_over_Cm)
                               ^
```
[R/mbd_loglik_utils.R:320:25:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L320) *style:* **Put spaces around all infix operators.**
```r
  one_over_qm_binom <- 1/choose((m + soc), soc); length(one_over_qm_binom)
                       ~^~
```
[R/mbd_loglik_utils.R:321:5:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L321) *style:* **Commented code should be removed.**
```r
  # Qi <- c(1, rep(0, lx)); length(Qi)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:322:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L322) *style:* **Lines should not be more than 80 characters.**
```r
  Qi <- rep(0, lx + 1);  Qi[3] <- 1 #starting with k = 0 and m = 2 missing species
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:322:3:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L322) *style:* **Variable or function name should be snake_case.**
```r
  Qi <- rep(0, lx + 1);  Qi[3] <- 1 #starting with k = 0 and m = 2 missing species
  ^~
```
[R/mbd_loglik_utils.R:323:3:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L323) *warning:* **local variable ‘k’ assigned but may not be used**
```r
  k <- 0 #assuming 0 species
  ^
```
[R/mbd_loglik_utils.R:325:3:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L325) *style:* **Variable or function name should be snake_case.**
```r
  TM <- create_A(lambda = lambda, mu = mu, nu = nu, q = q, k = 0,
  ^~
```
[R/mbd_loglik_utils.R:326:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L326) *style:* **Lines should not be more than 80 characters.**
```r
                       max_number_of_species = lx); #dim(TM); max(is.na(TM)); max(is.infinite(TM))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:326:54:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L326) *style:* **Commented code should be removed.**
```r
                       max_number_of_species = lx); #dim(TM); max(is.na(TM)); max(is.infinite(TM))
                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:328:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L328) *style:* **Lines should not be more than 80 characters.**
```r
  A2_v1 <- A_operator(Q = Qi, transition_matrix = TM, time_interval = total_time,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:328:3:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L328) *style:* **Variable or function name should be snake_case.**
```r
  A2_v1 <- A_operator(Q = Qi, transition_matrix = TM, time_interval = total_time,
  ^~~~~
```
[R/mbd_loglik_utils.R:329:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L329) *style:* **Lines should not be more than 80 characters.**
```r
                            precision = 250L, methode = methode, a_abstol = abstol, a_reltol = reltol); A2_v1
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:331:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L331) *style:* **Lines should not be more than 80 characters.**
```r
  # A2_v1 <- try(expoRkit::expv(v = Qi, x = TM, t = total_time, m = 50L), silent = T)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:331:5:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L331) *style:* **Commented code should be removed.**
```r
  # A2_v1 <- try(expoRkit::expv(v = Qi, x = TM, t = total_time, m = 50L), silent = T)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:334:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L334) *style:* **Lines should not be more than 80 characters.**
```r
  tips_components <- 1 + 0:1 #these are the components I want to exclude (the one corresponding to 0 and 1 tips)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:335:3:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L335) *style:* **Variable or function name should be snake_case.**
```r
  Pc <- 1 - sum(total_product[tips_components]); Pc
  ^~
```
[R/mbd_loglik_utils.R:336:5:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L336) *style:* **Commented code should be removed.**
```r
  # Pc <- sum(total_product)
    ^~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:347:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L347) *style:* **Variable and function names should not be longer than 30 characters.**
```r
calculate_conditional_probability0 <- function(
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:353:13:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L353) *style:* **Only use double-quotes.**
```r
  methode = 'expo',
            ^~~~~~
```
[R/mbd_loglik_utils.R:361:3:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L361) *style:* **Variable or function name should be snake_case.**
```r
  one_over_Cm <- (3 * (m + 1))/(m + 3); length(one_over_Cm)
  ^~~~~~~~~~~
```
[R/mbd_loglik_utils.R:361:31:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L361) *style:* **Put spaces around all infix operators.**
```r
  one_over_Cm <- (3 * (m + 1))/(m + 3); length(one_over_Cm)
                             ~^~
```
[R/mbd_loglik_utils.R:361:32:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L361) *style:* **Place a space before left parenthesis, except in a function call.**
```r
  one_over_Cm <- (3 * (m + 1))/(m + 3); length(one_over_Cm)
                               ^
```
[R/mbd_loglik_utils.R:362:25:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L362) *style:* **Put spaces around all infix operators.**
```r
  one_over_qm_binom <- 1/choose((m + soc), soc); length(one_over_qm_binom)
                       ~^~
```
[R/mbd_loglik_utils.R:363:3:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L363) *style:* **Variable or function name should be snake_case.**
```r
  Qi <- c(1, rep(0, lx)); length(Qi)
  ^~
```
[R/mbd_loglik_utils.R:365:3:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L365) *style:* **Variable or function name should be snake_case.**
```r
  TM <- create_A(lambda = lambda, mu = mu, nu = nu, q = q, k = soc,
  ^~
```
[R/mbd_loglik_utils.R:366:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L366) *style:* **Lines should not be more than 80 characters.**
```r
                       max_number_of_species = lx); #dim(TM); max(is.na(TM)); max(is.infinite(TM))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:366:54:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L366) *style:* **Commented code should be removed.**
```r
                       max_number_of_species = lx); #dim(TM); max(is.na(TM)); max(is.infinite(TM))
                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:368:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L368) *style:* **Lines should not be more than 80 characters.**
```r
  A2_v1 <- A_operator(Q = Qi, transition_matrix = TM, time_interval = total_time,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:368:3:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L368) *style:* **Variable or function name should be snake_case.**
```r
  A2_v1 <- A_operator(Q = Qi, transition_matrix = TM, time_interval = total_time,
  ^~~~~
```
[R/mbd_loglik_utils.R:371:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L371) *style:* **Lines should not be more than 80 characters.**
```r
  # A2_v1 <- try(expoRkit::expv(v = Qi, x = TM, t = total_time, m = 50L), silent = T)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:371:5:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L371) *style:* **Commented code should be removed.**
```r
  # A2_v1 <- try(expoRkit::expv(v = Qi, x = TM, t = total_time, m = 50L), silent = T)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:374:54:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L374) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
  missingspecies_min <- max((tips_interval[1] - 2), 0 )
                                                     ^
```
[R/mbd_loglik_utils.R:376:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L376) *style:* **Lines should not be more than 80 characters.**
```r
  tips_components <- 1 + c(missingspecies_min, missingspecies_max) # +1 is because of the zero-th component
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:377:3:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L377) *style:* **Variable or function name should be snake_case.**
```r
  Pc <- sum(total_product[tips_components[1]:tips_components[2]])
  ^~
```
[R/mbd_loglik_utils.R:378:5:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L378) *style:* **Commented code should be removed.**
```r
  # Pc <- sum(total_product)
    ^~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:389:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L389) *style:* **Variable and function names should not be longer than 30 characters.**
```r
calculate_conditional_probability0PB <- function(
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:389:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L389) *style:* **Variable or function name should be snake_case.**
```r
calculate_conditional_probability0PB <- function(
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:395:13:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L395) *style:* **Only use double-quotes.**
```r
  methode = 'expo',
            ^~~~~~
```
[R/mbd_loglik_utils.R:401:16:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L401) *style:* **Opening curly braces should never go on their own line and should always be followed by a new line.**
```r
  if (mu != 0) {
               ^
```
[R/mbd_loglik_utils.R:401:17:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L401) *style:* **Trailing whitespace is superfluous.**
```r
  if (mu != 0) {
                ^
```
[R/mbd_loglik_utils.R:402:9:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L402) *style:* **Only use double-quotes.**
```r
    cat('mu is supposed to be equal zero to use this function')
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:403:12:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L403) *style:* **Variable or function name should be snake_case.**
```r
    return(Pc <- NA)
           ^~
```
[R/mbd_loglik_utils.R:407:3:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L407) *style:* **Variable or function name should be snake_case.**
```r
  one_over_Cm <- (3 * (m + 1))/(m + 3); length(one_over_Cm)
  ^~~~~~~~~~~
```
[R/mbd_loglik_utils.R:407:31:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L407) *style:* **Put spaces around all infix operators.**
```r
  one_over_Cm <- (3 * (m + 1))/(m + 3); length(one_over_Cm)
                             ~^~
```
[R/mbd_loglik_utils.R:407:32:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L407) *style:* **Place a space before left parenthesis, except in a function call.**
```r
  one_over_Cm <- (3 * (m + 1))/(m + 3); length(one_over_Cm)
                               ^
```
[R/mbd_loglik_utils.R:408:25:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L408) *style:* **Put spaces around all infix operators.**
```r
  one_over_qm_binom <- 1/choose((m + soc), soc); length(one_over_qm_binom)
                       ~^~
```
[R/mbd_loglik_utils.R:409:3:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L409) *style:* **Variable or function name should be snake_case.**
```r
  Qi <- c(1, rep(0, lx)); length(Qi)
  ^~
```
[R/mbd_loglik_utils.R:411:3:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L411) *style:* **Variable or function name should be snake_case.**
```r
  TM <- create_A(lambda = lambda, mu = mu, nu = nu, q = q, k = soc,
  ^~
```
[R/mbd_loglik_utils.R:412:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L412) *style:* **Lines should not be more than 80 characters.**
```r
                       max_number_of_species = lx); #dim(TM); max(is.na(TM)); max(is.infinite(TM))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:412:54:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L412) *style:* **Commented code should be removed.**
```r
                       max_number_of_species = lx); #dim(TM); max(is.na(TM)); max(is.infinite(TM))
                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:414:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L414) *style:* **Lines should not be more than 80 characters.**
```r
  A2_v1 <- A_operator(Q = Qi, transition_matrix = TM, time_interval = total_time,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:414:3:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L414) *style:* **Variable or function name should be snake_case.**
```r
  A2_v1 <- A_operator(Q = Qi, transition_matrix = TM, time_interval = total_time,
  ^~~~~
```
[R/mbd_loglik_utils.R:415:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L415) *style:* **Lines should not be more than 80 characters.**
```r
                            precision = 250L, methode = methode, a_abstol = abstol, a_reltol = reltol)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:417:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L417) *style:* **Lines should not be more than 80 characters.**
```r
  # A2_v1 <- try(expoRkit::expv(v = Qi, x = TM, t = total_time, m = 50L), silent = T)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:417:5:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L417) *style:* **Commented code should be removed.**
```r
  # A2_v1 <- try(expoRkit::expv(v = Qi, x = TM, t = total_time, m = 50L), silent = T)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:420:54:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L420) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
  missingspecies_min <- max((tips_interval[1] - 2), 0 )
                                                     ^
```
[R/mbd_loglik_utils.R:422:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L422) *style:* **Lines should not be more than 80 characters.**
```r
  tips_components <- 1 + c(missingspecies_min, missingspecies_max) # +1 is because of the zero-th component
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:423:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L423) *style:* **Lines should not be more than 80 characters.**
```r
  opposite_tips_components <- (m + 1)[!((m + 1) %in% (tips_components[1]:tips_components[2]))]
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:424:5:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L424) *style:* **Commented code should be removed.**
```r
  # Pc <- sum(total_product[tips_components[1]:tips_components[2]])
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:425:3:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L425) *style:* **Variable or function name should be snake_case.**
```r
  Pc <- 1 - sum(total_product[opposite_tips_components])
  ^~
```
[R/mbd_loglik_utils.R:426:5:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L426) *style:* **Commented code should be removed.**
```r
  # Pc <- sum(total_product)
    ^~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:436:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L436) *style:* **Variable or function name should be snake_case.**
```r
find_best_lx_for_Pc <- function(
^~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:440:13:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L440) *style:* **Only use double-quotes.**
```r
  methode = 'expo',
            ^~~~~~
```
[R/mbd_loglik_utils.R:447:18:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L447) *style:* **Put spaces around all infix operators.**
```r
  a <- iterations/2
                ~^~
```
[R/mbd_loglik_utils.R:449:32:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L449) *style:* **Put spaces around all infix operators.**
```r
  step1 <- floor(interval_width/a)
                              ~^~
```
[R/mbd_loglik_utils.R:451:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L451) *style:* **Lines should not be more than 80 characters.**
```r
  lx_test <- rep(NA, length(lxvec <- seq(interval_min + step1, interval_max - step1, step1))); i <- 1; right.lx_coord <- 0
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:451:104:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L451) *style:* **Variable or function name should be snake_case.**
```r
  lx_test <- rep(NA, length(lxvec <- seq(interval_min + step1, interval_max - step1, step1))); i <- 1; right.lx_coord <- 0
                                                                                ^~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:465:9:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L465) *style:* **Variable or function name should be snake_case.**
```r
        right.lx_coord <- i
        ^~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:473:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L473) *style:* **Lines should not be more than 80 characters.**
```r
    right.lx_coord <- which(abs(lx_test - 1) == min(abs(lx_test - 1), na.rm = TRUE))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:473:5:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L473) *style:* **Variable or function name should be snake_case.**
```r
    right.lx_coord <- which(abs(lx_test - 1) == min(abs(lx_test - 1), na.rm = TRUE))
    ^~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:477:1:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L477) *style:* **Lines should not be more than 80 characters.**
```r
  lx_test2 <- rep(NA, length(lxvec2 <- floor(seq(lx - step1, lx + step1, 2 * step1/a)))); j <- 1; right.lx_coord2 <- 0
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:477:83:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L477) *style:* **Put spaces around all infix operators.**
```r
  lx_test2 <- rep(NA, length(lxvec2 <- floor(seq(lx - step1, lx + step1, 2 * step1/a)))); j <- 1; right.lx_coord2 <- 0
                                                                                ~^~
```
[R/mbd_loglik_utils.R:477:99:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L477) *style:* **Variable or function name should be snake_case.**
```r
  lx_test2 <- rep(NA, length(lxvec2 <- floor(seq(lx - step1, lx + step1, 2 * step1/a)))); j <- 1; right.lx_coord2 <- 0
                                                                                ^~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:491:9:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L491) *style:* **Variable or function name should be snake_case.**
```r
        right.lx_coord2 <- j
        ^~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:491:29:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L491) *style:* **Trailing whitespace is superfluous.**
```r
        right.lx_coord2 <- j
                            ^
```
[R/mbd_loglik_utils.R:492:38:](https://github.com/Giappo/mbd/blob/e219359514f4f3d6fd9ba6994ce446f32fa0b352/R/mbd_loglik_utils.R#L492) *style:* **Trailing whitespace is superfluous.**
```r
        lx <- lxvec2[right.lx_coord2]
                                     ^
```


Имел в виду избавиться от передачи типа в конструктор. У нас PassengerTrain  может быть только типа 'passanger'. А сейчас допустимо создать PassengerTrain.new(number, 'cargo'). Поэтому будет правильнее инициализировать тип в подклассе.


are you sure you need to introduce a dependency to `Irmin_unix` here? I would be nice to be able to compile `Irmin_graphql` without depending on `irmin-unix`, so we can use it with mirage.


Из названия не сразу понятно что он станцию возвращает, я сначала подумал что он только показывает что-то. Думаю select_station лучше подойдет


Many thanks for changing the column names! Big respect!


> В репе Railway.rb, должен быть railway.rb

Спасибо, исправил


\o/ :)


Да, это поправил  в новом коммите значениями по умолчанию.


JSONSerialization.ReadingOptions.allowFragments
→.allowFragments


I'm working on a refresh for the "Coyote's Run" mission pack. Link here for an OXP that just contains a single station from my current working set. [https://app.box.com/s/7e6exz4lhg02r88lwnjuo8g18i6dsuii](url)
Test in debug window with:

> :test [Avernus-station-test]


开发环境


Thank you for the great effort to write the tests. Please review the RegistrationTests class, it has to extend the BaseTest class so that the variables in the test_base module can be accessible


I tried last time, this line won't get displayed even if username is not inside DB, it goes straight to "Wrong password!"


Мне кажется, так точно не сколняется


Но я же все равно могу создать PassengerTrain.new(number, 'cargo'), давай запретим это


We should store it as a tuple. Literally `@doc delegate_to {target, as, length(as_args)}` and then we need to change IO.ANSI.Docs to be able to format said tuple.


hi @zoontek, why is it deprecated? I would like to know more detail.


umm ... this is how workers talk to buildbot, too?


h


Shouldn't we add 11 as well now ?