[R/default_params_doc.R:176:3:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/default_params_doc.R#L176) *style:* **Variable or function name should be snake_case.**
```r
  N,
  ^
```
[R/default_params_doc.R:177:3:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/default_params_doc.R#L177) *style:* **Variable or function name should be snake_case.**
```r
  N0,
  ^~
```
[R/default_params_doc.R:188:3:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/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/647ab40acee8979a7c2a20c8b80bb24479e31316/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:30:52:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_choosepar.R#L30) *style:* **Opening curly braces should never go on their own line and should always be followed by a new line.**
```r
  if (length(trparsopt) == 4 && missing(trparsfix)){trparsfix <- NULL}
                                                   ^
```
[R/mbd_loglik_choosepar.R:30:70:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_choosepar.R#L30) *style:* **Closing curly-braces should always be on their own line, unless it's followed by an else.**
```r
  if (length(trparsopt) == 4 && missing(trparsfix)){trparsfix <- NULL}
                                                                     ^
```
[R/mbd_loglik_choosepar.R:31:11:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_choosepar.R#L31) *style:* **Use <-, not =, for assignment.**
```r
  trpars1 = rep(0, n_pars)
          ^
```
[R/mbd_loglik_choosepar.R:34:3:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_choosepar.R#L34) *style:* **Opening curly braces should never go on their own line and should always be followed by a new line.**
```r
  {
  ^
```
[R/mbd_loglik_choosepar.R:37:7:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_choosepar.R#L37) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
  if ( min(trpars1[1:n_pars]) < 0 ){loglik <- -Inf}else
      ^
```
[R/mbd_loglik_choosepar.R:37:34:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_choosepar.R#L37) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
  if ( min(trpars1[1:n_pars]) < 0 ){loglik <- -Inf}else
                                 ^
```
[R/mbd_loglik_choosepar.R:37:36:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_choosepar.R#L37) *style:* **Opening curly braces should never go on their own line and should always be followed by a new line.**
```r
  if ( min(trpars1[1:n_pars]) < 0 ){loglik <- -Inf}else
                                   ^
```
[R/mbd_loglik_choosepar.R:37:51:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_choosepar.R#L37) *style:* **Closing curly-braces should always be on their own line, unless it's followed by an else.**
```r
  if ( min(trpars1[1:n_pars]) < 0 ){loglik <- -Inf}else
                                                  ^
```
[R/mbd_loglik_choosepar.R:38:3:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_choosepar.R#L38) *style:* **Opening curly braces should never go on their own line and should always be followed by a new line.**
```r
  {
  ^
```
[R/mbd_loglik_choosepar.R:40:5:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_choosepar.R#L40) *style:* **Opening curly braces should never go on their own line and should always be followed by a new line.**
```r
    {
    ^
```
[R/mbd_loglik_choosepar.R:42:23:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_choosepar.R#L42) *style:* **Put spaces around all infix operators.**
```r
      pars1 <- trpars1/(1 - trpars1)
                     ~^~
```
[R/mbd_loglik_choosepar.R:42:24:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_choosepar.R#L42) *style:* **Place a space before left parenthesis, except in a function call.**
```r
      pars1 <- trpars1/(1 - trpars1)
                       ^
```
[R/mbd_loglik_choosepar.R:44:5:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_choosepar.R#L44) *style:* **Opening curly braces should never go on their own line and should always be followed by a new line.**
```r
    {
    ^
```
[R/mbd_loglik_choosepar.R:60:3:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_choosepar.R#L60) *style:* **Opening curly braces should never go on their own line and should always be followed by a new line.**
```r
  {
  ^
```
[R/mbd_loglik_choosepar.R:61:1:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_choosepar.R#L61) *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/647ab40acee8979a7c2a20c8b80bb24479e31316/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/647ab40acee8979a7c2a20c8b80bb24479e31316/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/647ab40acee8979a7c2a20c8b80bb24479e31316/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/647ab40acee8979a7c2a20c8b80bb24479e31316/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/647ab40acee8979a7c2a20c8b80bb24479e31316/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/647ab40acee8979a7c2a20c8b80bb24479e31316/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:9:11:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L9) *style:* **Put spaces around all infix operators.**
```r
  A1 <- (1-q)^(k) * choose(k, j) * (2)^j
         ~^~
```
[R/mbd_loglik_utils.R:9:15:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L9) *style:* **Place a space before left parenthesis, except in a function call.**
```r
  A1 <- (1-q)^(k) * choose(k, j) * (2)^j
              ^
```
[R/mbd_loglik_utils.R:10:3:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/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/647ab40acee8979a7c2a20c8b80bb24479e31316/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:11:24:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L11) *style:* **Put spaces around all infix operators.**
```r
  A <- diag(A1[1], nrow=N+2, ncol=N+2)
                      ~^~
```
[R/mbd_loglik_utils.R:11:26:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L11) *style:* **Put spaces around all infix operators.**
```r
  A <- diag(A1[1], nrow=N+2, ncol=N+2)
                        ~^~
```
[R/mbd_loglik_utils.R:11:34:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L11) *style:* **Put spaces around all infix operators.**
```r
  A <- diag(A1[1], nrow=N+2, ncol=N+2)
                                ~^~
```
[R/mbd_loglik_utils.R:11:36:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L11) *style:* **Put spaces around all infix operators.**
```r
  A <- diag(A1[1], nrow=N+2, ncol=N+2)
                                  ~^~
```
[R/mbd_loglik_utils.R:12:9:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L12) *style:* **Put spaces around all infix operators.**
```r
  A[1:(k+1),1] <- A1
       ~^~
```
[R/mbd_loglik_utils.R:12:13:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/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:15:20:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L15) *style:* **Commas should always have a space after.**
```r
    s <- src:min(N,2*src+k-1)
                   ^
```
[R/mbd_loglik_utils.R:15:21:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L15) *style:* **Put spaces around all infix operators.**
```r
    s <- src:min(N,2*src+k-1)
                   ~^~
```
[R/mbd_loglik_utils.R:15:25:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L15) *style:* **Put spaces around all infix operators.**
```r
    s <- src:min(N,2*src+k-1)
                       ~^~
```
[R/mbd_loglik_utils.R:15:27:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L15) *style:* **Put spaces around all infix operators.**
```r
    s <- src:min(N,2*src+k-1)
                         ~^~
```
[R/mbd_loglik_utils.R:16:8:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L16) *style:* **Put spaces around all infix operators.**
```r
    A[s+2, dst] <- A[s, src] + A[s+1, src]
      ~^~
```
[R/mbd_loglik_utils.R:16:35:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L16) *style:* **Put spaces around all infix operators.**
```r
    A[s+2, dst] <- A[s, src] + A[s+1, src]
                                 ~^~
```
[R/mbd_loglik_utils.R:17:11:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L17) *style:* **Put spaces around all infix operators.**
```r
    m <- s-1; n <- src-1;
         ~^~
```
[R/mbd_loglik_utils.R:17:23:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L17) *style:* **Put spaces around all infix operators.**
```r
    m <- s-1; n <- src-1;
                     ~^~
```
[R/mbd_loglik_utils.R:18:32:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/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:34:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/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:37:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/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:38:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/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:40:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/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:44:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/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:46:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/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:48:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/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:20:7:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L20) *style:* **Commas should always have a space after.**
```r
  A[N,N] = A[N,N] * (1-q)^(N-1);
      ^
```
[R/mbd_loglik_utils.R:20:10:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/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:20:16:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L20) *style:* **Commas should always have a space after.**
```r
  A[N,N] = A[N,N] * (1-q)^(N-1);
               ^
```
[R/mbd_loglik_utils.R:20:23:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L20) *style:* **Put spaces around all infix operators.**
```r
  A[N,N] = A[N,N] * (1-q)^(N-1);
                     ~^~
```
[R/mbd_loglik_utils.R:20:27:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L20) *style:* **Place a space before left parenthesis, except in a function call.**
```r
  A[N,N] = A[N,N] * (1-q)^(N-1);
                          ^
```
[R/mbd_loglik_utils.R:20:29:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L20) *style:* **Put spaces around all infix operators.**
```r
  A[N,N] = A[N,N] * (1-q)^(N-1);
                           ~^~
```
[R/mbd_loglik_utils.R:21:9:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L21) *style:* **Commas should always have a space after.**
```r
  A[1:N,1:N]
        ^
```
[R/mbd_loglik_utils.R:24:3:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/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/647ab40acee8979a7c2a20c8b80bb24479e31316/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/647ab40acee8979a7c2a20c8b80bb24479e31316/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/647ab40acee8979a7c2a20c8b80bb24479e31316/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/647ab40acee8979a7c2a20c8b80bb24479e31316/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/647ab40acee8979a7c2a20c8b80bb24479e31316/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/647ab40acee8979a7c2a20c8b80bb24479e31316/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/647ab40acee8979a7c2a20c8b80bb24479e31316/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/647ab40acee8979a7c2a20c8b80bb24479e31316/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/647ab40acee8979a7c2a20c8b80bb24479e31316/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/647ab40acee8979a7c2a20c8b80bb24479e31316/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/647ab40acee8979a7c2a20c8b80bb24479e31316/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/647ab40acee8979a7c2a20c8b80bb24479e31316/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/647ab40acee8979a7c2a20c8b80bb24479e31316/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/647ab40acee8979a7c2a20c8b80bb24479e31316/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/647ab40acee8979a7c2a20c8b80bb24479e31316/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/647ab40acee8979a7c2a20c8b80bb24479e31316/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/647ab40acee8979a7c2a20c8b80bb24479e31316/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/647ab40acee8979a7c2a20c8b80bb24479e31316/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/647ab40acee8979a7c2a20c8b80bb24479e31316/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/647ab40acee8979a7c2a20c8b80bb24479e31316/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:59:3:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L59) *style:* **Variable or function name should be snake_case.**
```r
  M <- create_A0(max_number_of_species = max_number_of_species,
  ^
```
[R/mbd_loglik_utils.R:61:1:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/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/647ab40acee8979a7c2a20c8b80bb24479e31316/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/647ab40acee8979a7c2a20c8b80bb24479e31316/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/647ab40acee8979a7c2a20c8b80bb24479e31316/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/647ab40acee8979a7c2a20c8b80bb24479e31316/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/647ab40acee8979a7c2a20c8b80bb24479e31316/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/647ab40acee8979a7c2a20c8b80bb24479e31316/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/647ab40acee8979a7c2a20c8b80bb24479e31316/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:3:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L75) *style:* **Variable or function name should be snake_case.**
```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/647ab40acee8979a7c2a20c8b80bb24479e31316/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/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L76) *style:* **Lines should not be more than 80 characters.**
```r
  B <- lambda * k * diag(max_number_of_species + 1) * (b == 1) + nu * choose(k, b) * (q^b) * M
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:76:3:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L76) *style:* **Variable or function name should be snake_case.**
```r
  B <- lambda * k * diag(max_number_of_species + 1) * (b == 1) + nu * choose(k, b) * (q^b) * M
  ^
```
[R/mbd_loglik_utils.R:85:1:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L85) *style:* **Variable or function name should be snake_case.**
```r
create_A.no_mbd = function(
^~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:85:17:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L85) *style:* **Use <-, not =, for assignment.**
```r
create_A.no_mbd = function(
                ^
```
[R/mbd_loglik_utils.R:95:1:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L95) *style:* **Lines should not be more than 80 characters.**
```r
  M <- create_A0(max_number_of_species = max_number_of_species, lambda = nu, mu = mu, q = q, k = k)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:95:3:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L95) *style:* **Variable or function name should be snake_case.**
```r
  M <- create_A0(max_number_of_species = max_number_of_species, lambda = nu, mu = mu, q = q, k = k)
  ^
```
[R/mbd_loglik_utils.R:95:8:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L95) *warning:* **no visible global function definition for ‘create_A0’**
```r
  M <- create_A0(max_number_of_species = max_number_of_species, lambda = nu, mu = mu, q = q, k = k)
       ^~~~~~~~~
```
[R/mbd_loglik_utils.R:96:1:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L96) *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:96:97:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L96) *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:96:99:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L96) *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:97:1:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L97) *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:107:1:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L107) *style:* **Lines should not be more than 80 characters.**
```r
create_B.no_mbd = function(lambda, nu, q, k, b, max_number_of_species, minimum_multiple_births){
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:107:1:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L107) *style:* **Variable or function name should be snake_case.**
```r
create_B.no_mbd = function(lambda, nu, q, k, b, max_number_of_species, minimum_multiple_births){
^~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:107:17:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L107) *style:* **Use <-, not =, for assignment.**
```r
create_B.no_mbd = function(lambda, nu, q, k, b, max_number_of_species, minimum_multiple_births){
                ^
```
[R/mbd_loglik_utils.R:108:1:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L108) *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:108:3:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L108) *style:* **Variable or function name should be snake_case.**
```r
  M <- create_B0(max_number_of_species = max_number_of_species, q = q, k = k, b = b)
  ^
```
[R/mbd_loglik_utils.R:108:8:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L108) *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:109:1:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L109) *style:* **Lines should not be more than 80 characters.**
```r
  B <- lambda * k * diag(max_number_of_species + 1) * (b == 1) + nu * choose(k, b) * (q^b) * M
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:109:3:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L109) *style:* **Variable or function name should be snake_case.**
```r
  B <- lambda * k * diag(max_number_of_species + 1) * (b == 1) + nu * choose(k, b) * (q^b) * M
  ^
```
[R/mbd_loglik_utils.R:110:48:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L110) *style:* **Use <-, not =, for assignment.**
```r
  B[row(B) > col(B) + minimum_multiple_births] = 0
                                               ^
```
[R/mbd_loglik_utils.R:119:1:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L119) *style:* **Variable or function name should be snake_case.**
```r
A_operator <- function(Q, transition_matrix, time_interval, precision = 50L,
^~~~~~~~~~
```
[R/mbd_loglik_utils.R:119:24:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L119) *style:* **Variable or function name should be snake_case.**
```r
A_operator <- function(Q, transition_matrix, time_interval, precision = 50L,
                       ^
```
[R/mbd_loglik_utils.R:130:3:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L130) *style:* **Opening curly braces should never go on their own line and should always be followed by a new line.**
```r
  {
  ^
```
[R/mbd_loglik_utils.R:132:7:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L132) *style:* **Commented code should be removed.**
```r
    # exp_matrix <- rsexpm:::sexpm(transition_matrix * time_interval)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:133:7:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L133) *style:* **Commented code should be removed.**
```r
    # result     <- exp_matrix %*% Q
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:137:3:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L137) *style:* **Opening curly braces should never go on their own line and should always be followed by a new line.**
```r
  {
  ^
```
[R/mbd_loglik_utils.R:138:5:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L138) *style:* **Variable or function name should be snake_case.**
```r
    result.nan <- result.negative <- 1
    ^~~~~~~~~~
```
[R/mbd_loglik_utils.R:138:19:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L138) *style:* **Variable or function name should be snake_case.**
```r
    result.nan <- result.negative <- 1
                  ^~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:140:1:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L140) *style:* **Lines should not be more than 80 characters.**
```r
    while ((result.nan == 1| result.negative == 1) & repetition < max_repetitions)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:140:28:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L140) *style:* **Put spaces around all infix operators.**
```r
    while ((result.nan == 1| result.negative == 1) & repetition < max_repetitions)
                          ~^
```
[R/mbd_loglik_utils.R:141:5:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L141) *style:* **Opening curly braces should never go on their own line and should always be followed by a new line.**
```r
    {
    ^
```
[R/mbd_loglik_utils.R:142:1:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L142) *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:144:7:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L144) *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:146:7:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L146) *style:* **Opening curly braces should never go on their own line and should always be followed by a new line.**
```r
      {
      ^
```
[R/mbd_loglik_utils.R:149:7:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L149) *style:* **Opening curly braces should never go on their own line and should always be followed by a new line.**
```r
      {
      ^
```
[R/mbd_loglik_utils.R:150:9:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L150) *style:* **Variable or function name should be snake_case.**
```r
        result.negative <- (any(result < 0))
        ^~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:152:9:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L152) *style:* **Opening curly braces should never go on their own line and should always be followed by a new line.**
```r
        {
        ^
```
[R/mbd_loglik_utils.R:155:11:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L155) *style:* **Opening curly braces should never go on their own line and should always be followed by a new line.**
```r
          {
          ^
```
[R/mbd_loglik_utils.R:165:20:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L165) *style:* **Opening curly braces should never go on their own line and should always be followed by a new line.**
```r
  if (!bad_result) {bad_result <- (any(result < 0))}
                   ^
```
[R/mbd_loglik_utils.R:165:52:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L165) *style:* **Closing curly-braces should always be on their own line, unless it's followed by an else.**
```r
  if (!bad_result) {bad_result <- (any(result < 0))}
                                                   ^
```
[R/mbd_loglik_utils.R:168:3:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L168) *style:* **Opening curly braces should never go on their own line and should always be followed by a new line.**
```r
  {
  ^
```
[R/mbd_loglik_utils.R:171:1:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L171) *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:171:78:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L171) *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:171:150:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L171) *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:181:1:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L181) *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:192:1:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L192) *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:193:1:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L193) *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:196:1:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L196) *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:202:1:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L202) *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:209:1:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L209) *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:210:1:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L210) *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:213:1:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L213) *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:217:1:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L217) *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:218:1:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L218) *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:220:1:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L220) *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:224:1:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L224) *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:225:1:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L225) *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:228:1:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L228) *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:229:1:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L229) *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:245:21:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L245) *style:* **Use <-, not =, for assignment.**
```r
    starting_vector = x
                    ^
```
[R/mbd_loglik_utils.R:246:23:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L246) *style:* **Use <-, not =, for assignment.**
```r
    transition_matrix = pars
                      ^
```
[R/mbd_loglik_utils.R:247:9:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L247) *style:* **Use <-, not =, for assignment.**
```r
    dx  = rep(0, length(starting_vector))
        ^
```
[R/mbd_loglik_utils.R:248:9:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L248) *style:* **Use <-, not =, for assignment.**
```r
    dx  = drop(transition_matrix %*% starting_vector)
        ^
```
[R/mbd_loglik_utils.R:249:9:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L249) *style:* **Use <-, not =, for assignment.**
```r
    out = (dx)
        ^
```
[R/mbd_loglik_utils.R:250:16:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L250) *style:* **Use <-, not =, for assignment.**
```r
    names(out) = names(x)
               ^
```
[R/mbd_loglik_utils.R:260:1:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L260) *style:* **Lines should not be more than 80 characters.**
```r
determine_k_limit <- function(pars, brts, lx, soc, methode, abstol = 1e-16, reltol = 1e-10) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:261:22:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L261) *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:263:3:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L263) *style:* **Variable or function name should be snake_case.**
```r
  Qi <- c(1, rep(0, lx))
  ^~
```
[R/mbd_loglik_utils.R:265:3:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L265) *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:266:1:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L266) *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:266:54:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L266) *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:267:3:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L267) *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:268:1:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L268) *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:269:5:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L269) *style:* **Commented code should be removed.**
```r
  # graphics::plot((Pm/sum(Pm)))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:270:1:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L270) *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:270:56:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L270) *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:279:1:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L279) *style:* **Variable and function names should not be longer than 30 characters.**
```r
calculate_conditional_probability <- function(
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:285:13:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L285) *style:* **Only use double-quotes.**
```r
  methode = 'expo',
            ^~~~~~
```
[R/mbd_loglik_utils.R:293:3:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L293) *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:293:31:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L293) *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:293:32:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L293) *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:294:25:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L294) *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:295:5:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L295) *style:* **Commented code should be removed.**
```r
  # Qi <- c(1, rep(0, lx)); length(Qi)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:296:1:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L296) *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:296:3:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L296) *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:297:3:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L297) *warning:* **local variable ‘k’ assigned but may not be used**
```r
  k <- 0 #assuming 0 species
  ^
```
[R/mbd_loglik_utils.R:299:3:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L299) *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:300:1:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L300) *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:300:54:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L300) *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:302:1:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L302) *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:302:3:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L302) *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:303:1:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L303) *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:305:1:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L305) *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:305:5:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L305) *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:308:1:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L308) *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:309:3:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L309) *style:* **Variable or function name should be snake_case.**
```r
  Pc <- 1 - sum(total_product[tips_components]); Pc
  ^~
```
[R/mbd_loglik_utils.R:310:5:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L310) *style:* **Commented code should be removed.**
```r
  # Pc <- sum(total_product)
    ^~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:321:1:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L321) *style:* **Variable and function names should not be longer than 30 characters.**
```r
calculate_conditional_probability0 <- function(
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:327:13:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L327) *style:* **Only use double-quotes.**
```r
  methode = 'expo',
            ^~~~~~
```
[R/mbd_loglik_utils.R:335:3:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L335) *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:335:31:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L335) *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:335:32:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L335) *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:336:25:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L336) *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:337:3:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L337) *style:* **Variable or function name should be snake_case.**
```r
  Qi <- c(1, rep(0, lx)); length(Qi)
  ^~
```
[R/mbd_loglik_utils.R:339:3:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L339) *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:340:1:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L340) *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:340:54:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L340) *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:342:1:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L342) *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:342:3:](https://github.com/Giappo/mbd/blob/647ab40acee8979a7c2a20c8b80bb24479e31316/R/mbd_loglik_utils.R#L342) *style:* **Variable or function name should be snake_case.**
```r
  A2_v1 <- A_operator(Q = Qi, transition_matrix = TM, time_interval = total_time,
  ^~~~~
```