[R/mbd_loglik_utils.R:315:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_loglik_utils.R#L315) *style:* **Variable and function names should not be longer than 30 characters.**
```r
calculate_conditional_probability <- function(
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:363:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_loglik_utils.R#L363) *style:* **Variable and function names should not be longer than 30 characters.**
```r
calculate_conditional_probability0 <- function(
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:394:54:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_loglik_utils.R#L394) *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:421:12:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_loglik_utils.R#L421) *warning:* **local variable ‘pc’ assigned but may not be used**
```r
    return(pc <- NA)
           ^~
```
[R/mbd_loglik_utils.R:449:54:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_loglik_utils.R#L449) *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:553:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_loglik_utils.R#L553) *style:* **Variable and function names should not be longer than 30 characters.**
```r
calculate_conditional_probability1 <- function(
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:563:9:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_loglik_utils.R#L563) *warning:* **no visible global function definition for ‘find_best_lx_for_pc’**
```r
  lx <- find_best_lx_for_pc(brts = brts, pars = pars, soc = soc)
        ^~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:597:18:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_loglik_utils.R#L597) *warning:* **no visible global function definition for ‘brts2time_intervals_and_births’**
```r
  births <- c(0, brts2time_intervals_and_births(brts)$births)
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik_utils.R:640:16:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_loglik_utils.R#L640) *warning:* **no visible global function definition for ‘negatives_correction’**
```r
      a2_v1 <- negatives_correction(a2_v1, pars)
               ^~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik.R:84:13:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_loglik.R#L84) *warning:* **no visible global function definition for ‘brts2time_intervals_and_births’**
```r
    data <- brts2time_intervals_and_births(brts)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik.R:110:11:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_loglik.R#L110) *warning:* **local variable ‘max_number_of_species’ assigned but may not be used**
```r
    lx <- max_number_of_species <- alpha * max_k;
          ^~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik.R:170:23:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_loglik.R#L170) *warning:* **no visible global function definition for ‘negatives_correction’**
```r
          q_t[t, ] <- negatives_correction(q_t[t, ], pars)
                      ^~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik.R:188:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_loglik.R#L188) *style:* **Lines should not be more than 80 characters.**
```r
          matrix_b <- create_b(lambda = lambda, nu = nu, q = q, k = k, b = births[t],
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik.R:192:25:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_loglik.R#L192) *warning:* **no visible global function definition for ‘negatives_correction’**
```r
            q_t[t, ] <- negatives_correction(q_t[t, ], pars)
                        ^~~~~~~~~~~~~~~~~~~~
```
[R/mbd_loglik.R:231:5:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_loglik.R#L231) *style:* **Variable or function name should be snake_case.**
```r
    P  <- vm * q_t[t, (missnumspec + 1)]
    ^
```
[R/mbd_ml.R:85:31:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_ml.R#L85) *style:* **Opening curly braces should never go on their own line and should always be followed by a new line.**
```r
  if (length(idparsfix) == 0) {idparsfix <- NULL}
                              ^
```
[R/mbd_ml.R:85:49:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_ml.R#L85) *style:* **Closing curly-braces should always be on their own line, unless it's followed by an else.**
```r
  if (length(idparsfix) == 0) {idparsfix <- NULL}
                                                ^
```
[R/mbd_ml.R:131:15:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_ml.R#L131) *style:* **Use <-, not =, for assignment.**
```r
    trparsopt = initparsopt / (1 + initparsopt)
              ^
```
[R/mbd_ml.R:132:42:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_ml.R#L132) *style:* **Use <-, not =, for assignment.**
```r
    trparsopt[which(initparsopt == Inf)] = 1
                                         ^
```
[R/mbd_ml.R:133:15:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_ml.R#L133) *style:* **Use <-, not =, for assignment.**
```r
    trparsfix = parsfix / (1 + parsfix)
              ^
```
[R/mbd_ml.R:134:38:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_ml.R#L134) *style:* **Use <-, not =, for assignment.**
```r
    trparsfix[which(parsfix == Inf)] = 1
                                     ^
```
[R/mbd_ml.R:200:31:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_ml.R#L200) *style:* **Opening curly braces should never go on their own line and should always be followed by a new line.**
```r
  if (length(idparsfix) != 0) {ml_pars1[idparsfix] <- parsfix}
                              ^
```
[R/mbd_ml.R:200:62:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_ml.R#L200) *style:* **Closing curly-braces should always be on their own line, unless it's followed by an else.**
```r
  if (length(idparsfix) != 0) {ml_pars1[idparsfix] <- parsfix}
                                                             ^
```
[R/mbd_ml.R:201:3:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_ml.R#L201) *style:* **Variable or function name should be snake_case.**
```r
  ML <- as.numeric(unlist(out$fvalues))
  ^~
```
[R/mbd_pure_multiple_birth.R:30:13:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_pure_multiple_birth.R#L30) *warning:* **no visible global function definition for ‘brts2time_intervals_and_births’**
```r
    data <- brts2time_intervals_and_births(test_brts)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_pure_multiple_birth.R:40:41:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_pure_multiple_birth.R#L40) *style:* **Put spaces around all infix operators.**
```r
      poisson_term <- stats::dpois(i, nu*time_intervals[t], log = FALSE)[
                                       ~^~
```
[R/mbd_pure_multiple_birth.R:41:27:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_pure_multiple_birth.R#L41) *style:* **Put spaces around all infix operators.**
```r
        stats::dpois(i, nu*time_intervals[t], log = FALSE) != 0]
                         ~^~
```
[R/mbd_pure_multiple_birth.R:42:33:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_pure_multiple_birth.R#L42) *style:* **Put spaces around all infix operators.**
```r
      ii <- i[stats::dpois(i, nu*time_intervals[t], log = FALSE) != 0 ]
                               ~^~
```
[R/mbd_pure_multiple_birth.R:42:70:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_pure_multiple_birth.R#L42) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
      ii <- i[stats::dpois(i, nu*time_intervals[t], log = FALSE) != 0 ]
                                                                     ^
```
[R/mbd_pure_multiple_birth.R:46:24:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_pure_multiple_birth.R#L46) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
      a_term[t] <- sum( (1 - q) ^ (ii * k[t]) * poisson_term ) * # (1)
                       ^
```
[R/mbd_pure_multiple_birth.R:46:61:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_pure_multiple_birth.R#L46) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
      a_term[t] <- sum( (1 - q) ^ (ii * k[t]) * poisson_term ) * # (1)
                                                            ^
```
[R/mbd_pure_multiple_birth.R:81:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_pure_multiple_birth.R#L81) *style:* **Lines should not be more than 80 characters.**
```r
  condition1 <- (any(is.nan(test_pars)) != 0 | any(is.infinite(test_pars)) != 0 )
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_pure_multiple_birth.R:81:80:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_pure_multiple_birth.R#L81) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
  condition1 <- (any(is.nan(test_pars)) != 0 | any(is.infinite(test_pars)) != 0 )
                                                                               ^
```
[R/mbd_pure_multiple_birth.R:86:13:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_pure_multiple_birth.R#L86) *warning:* **no visible global function definition for ‘brts2time_intervals_and_births’**
```r
    data <- brts2time_intervals_and_births(test_brts)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_pure_multiple_birth.R:90:47:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_pure_multiple_birth.R#L90) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
    a_term <- rep(1, length(time_intervals)    ) #branches
                                              ^
```
[R/mbd_pure_multiple_birth.R:100:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_pure_multiple_birth.R#L100) *style:* **Lines should not be more than 80 characters.**
```r
      # (1) nu contribution: (1-q)^(k*i) * (nu*(t_k-t_k-1))^i*exp(-nu*(t_k-t_k-1)) / i!
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_pure_multiple_birth.R:102:24:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_pure_multiple_birth.R#L102) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
      a_term[t] <- sum( (1 - q) ^ (ii * k[t]) * poisson_term ) * # (1)
                       ^
```
[R/mbd_pure_multiple_birth.R:102:61:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_pure_multiple_birth.R#L102) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
      a_term[t] <- sum( (1 - q) ^ (ii * k[t]) * poisson_term ) * # (1)
                                                            ^
```
[R/mbd_pure_multiple_birth.R:110:17:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_pure_multiple_birth.R#L110) *style:* **Place a space before left parenthesis, except in a function call.**
```r
        (1 - q)^(k[-length(k)] - births)                 # (1)
                ^
```
[R/mbd_pure_multiple_birth.R:149:33:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_pure_multiple_birth.R#L149) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
  if (min(trpars1[1:n_pars]) < 0 ) {
                                ^
```
[R/mbd_pure_multiple_birth.R:161:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_pure_multiple_birth.R#L161) *style:* **Lines should not be more than 80 characters.**
```r
    cat("There are parameter values used which cause numerical problems:", trpars1, "\n")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_pure_multiple_birth.R:185:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_pure_multiple_birth.R#L185) *style:* **Lines should not be more than 80 characters.**
```r
  # - changeloglikifnoconv = if T the loglik will be set to -Inf if ML does not converge
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_pure_multiple_birth.R:187:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_pure_multiple_birth.R#L187) *style:* **Lines should not be more than 80 characters.**
```r
  # - changeloglikifnoconv = if T the loglik will be set to -Inf if ML does not converge
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_pure_multiple_birth.R:188:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_pure_multiple_birth.R#L188) *style:* **Lines should not be more than 80 characters.**
```r
  # - optimmethod = "simplex" (current default) or 'subplex' (default of previous versions)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_pure_multiple_birth.R:193:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_pure_multiple_birth.R#L193) *style:* **Lines should not be more than 80 characters.**
```r
  n_pars <- length(namepars); #if you add more parameters to your model just change this
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_pure_multiple_birth.R:194:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_pure_multiple_birth.R#L194) *style:* **Lines should not be more than 80 characters.**
```r
  failpars <- rep(-1, n_pars); names(failpars) <- namepars; #those are the parameters that you get if something goes sideways
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_pure_multiple_birth.R:237:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_pure_multiple_birth.R#L237) *style:* **Lines should not be more than 80 characters.**
```r
      cat("The loglikelihood for the initial parameter values is", initloglik, "\n")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_pure_multiple_birth.R:240:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_pure_multiple_birth.R#L240) *style:* **Lines should not be more than 80 characters.**
```r
        cat("The initial parameter values have a likelihood that is equal to 0 or below machine precision. Try again with different initial values.\n")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_pure_multiple_birth.R:244:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_pure_multiple_birth.R#L244) *style:* **Lines should not be more than 80 characters.**
```r
                               fun = pmb_loglik_choosepar, trparsopt = trparsopt,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_pure_multiple_birth.R:249:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_pure_multiple_birth.R#L249) *style:* **Lines should not be more than 80 characters.**
```r
          cat("Optimization has not converged. Try again with different initial values.\n")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_pure_multiple_birth.R:264:11:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_pure_multiple_birth.R#L264) *style:* **Variable or function name should be snake_case.**
```r
          ML <- as.numeric(unlist(out$fvalues))
          ^~
```
[R/mbd_sim.R:92:7:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L92) *style:* **Variable or function name should be snake_case.**
```r
      L <- matrix(0, nrow = 1e6, 4)
      ^
```
[R/mbd_sim.R:101:11:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L101) *style:* **Variable or function name should be snake_case.**
```r
          deltaT <- stats::rexp(1, rate = total_rate)
          ^~~~~~
```
[R/mbd_sim.R:102:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L102) *style:* **Lines should not be more than 80 characters.**
```r
          outcome <- sample(c(-1, 1, 2), size = 1, prob = c(n_species * mu, n_species * lambda, nu))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:103:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L103) *style:* **Lines should not be more than 80 characters.**
```r
          delta_n <- -1 * (outcome == -1) + 1 * (outcome == 1) + (outcome == 2) * stats::rbinom(n = 1, size = n_species, prob = q)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:113:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L113) *style:* **Lines should not be more than 80 characters.**
```r
            L[new_interval, 1] <- t#-(delta_n:1)*1e-5 add this if you need separate time points
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:134:5:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L134) *style:* **Variable or function name should be snake_case.**
```r
    L <- L[(1:total_count), ]
    ^
```
[R/mbd_sim.R:142:35:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L142) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
    crown_species_dead <- (length( unique(sign(alive[, 3]))) != 2 ) * cond
                                  ^
```
[R/mbd_sim.R:142:66:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L142) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
    crown_species_dead <- (length( unique(sign(alive[, 3]))) != 2 ) * cond
                                                                 ^
```
[R/mbd_sim.R:144:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L144) *style:* **Lines should not be more than 80 characters.**
```r
    births.reconstructed_tree <- unlist(unname(sort(DDD::L2brts(L, dropextinct = TRUE), decreasing = TRUE)))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:144:5:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L144) *style:* **Variable or function name should be snake_case.**
```r
    births.reconstructed_tree <- unlist(unname(sort(DDD::L2brts(L, dropextinct = TRUE), decreasing = TRUE)))
    ^~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:145:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L145) *style:* **Lines should not be more than 80 characters.**
```r
    births.full_tree <- unlist(unname(sort(DDD::L2brts(L, dropextinct = FALSE), decreasing = TRUE)))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:145:5:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L145) *style:* **Variable or function name should be snake_case.**
```r
    births.full_tree <- unlist(unname(sort(DDD::L2brts(L, dropextinct = FALSE), decreasing = TRUE)))
    ^~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:146:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L146) *style:* **Lines should not be more than 80 characters.**
```r
    multiple_births.reconstructed_tree <- sum( duplicated(births.reconstructed_tree))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:146:5:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L146) *style:* **Variable and function names should not be longer than 30 characters.**
```r
    multiple_births.reconstructed_tree <- sum( duplicated(births.reconstructed_tree))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:146:5:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L146) *style:* **Variable or function name should be snake_case.**
```r
    multiple_births.reconstructed_tree <- sum( duplicated(births.reconstructed_tree))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:146:47:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L146) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
    multiple_births.reconstructed_tree <- sum( duplicated(births.reconstructed_tree))
                                              ^
```
[R/mbd_sim.R:147:5:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L147) *style:* **Variable or function name should be snake_case.**
```r
    multiple_births.full_tree <- sum( duplicated(births.full_tree))
    ^~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:147:38:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L147) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
    multiple_births.full_tree <- sum( duplicated(births.full_tree))
                                     ^
```
[R/mbd_sim.R:149:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L149) *style:* **Lines should not be more than 80 characters.**
```r
    # multiple_births_check = (multiple_births.full_tree>=minimum_multiple_births)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:149:7:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L149) *style:* **Commented code should be removed.**
```r
    # multiple_births_check = (multiple_births.full_tree>=minimum_multiple_births)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:150:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L150) *style:* **Lines should not be more than 80 characters.**
```r
    multiple_births_check <- (multiple_births.reconstructed_tree >= minimum_multiple_births)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:152:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L152) *style:* **Lines should not be more than 80 characters.**
```r
    keep_the_sim <- (!crown_species_dead) & (tips >= tips_interval[1] & tips <= tips_interval[2]) #should i keep this simulation?
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:154:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L154) *style:* **Lines should not be more than 80 characters.**
```r
  time_points <- unlist(unname(sort(DDD::L2brts(L, dropextinct = TRUE), decreasing = TRUE)))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:172:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L172) *style:* **Lines should not be more than 80 characters.**
```r
#' @description mbd_sim0 produces simulated trees including multiple speciations at the same time.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:179:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L179) *style:* **Lines should not be more than 80 characters.**
```r
#' @return The function returns a list of L table, branching times and number of extinct species.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:182:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L182) *style:* **Lines should not be more than 80 characters.**
```r
#'   \item tes is a tree-object corresponding to the reconstructed phylogenetic tree;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:184:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L184) *style:* **Lines should not be more than 80 characters.**
```r
#'   \item extinct_species is the number of species gone extinct before the present time;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:188:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L188) *style:* **Lines should not be more than 80 characters.**
```r
#'      \item second is the label of the parent of the species; positive and negative values only indicate whether the species belongs to the left or right crown lineage;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:189:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L189) *style:* **Lines should not be more than 80 characters.**
```r
#'      \item third is the label of the daughter species itself; positive and negative values only indicate whether the species belongs to the left or right crown lineage;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:190:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L190) *style:* **Lines should not be more than 80 characters.**
```r
#'      \item fourth is the time of extinction of the species. If this is equal to -1, then the species is still extant.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:195:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L195) *style:* **Lines should not be more than 80 characters.**
```r
#' out = mbd_sim0( pars=c(2.5, 0.1, 0.1), soc=2, age=10, cond=1, tips_interval=c(0,Inf))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:227:18:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L227) *style:* **Use <-, not =, for assignment.**
```r
      total_count=init_n_lineages
                 ^
```
[R/mbd_sim.R:227:18:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L227) *style:* **Put spaces around all infix operators.**
```r
      total_count=init_n_lineages
                ~^~
```
[R/mbd_sim.R:231:7:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L231) *style:* **Variable or function name should be snake_case.**
```r
      L <- matrix(0, nrow=1e6, 4)
      ^
```
[R/mbd_sim.R:231:26:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L231) *style:* **Put spaces around all infix operators.**
```r
      L <- matrix(0, nrow=1e6, 4)
                        ~^~
```
[R/mbd_sim.R:238:9:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L238) *style:* **Variable or function name should be snake_case.**
```r
        deltaT <- stats::rexp(1, rate = (lambda + n_species * mu))
        ^~~~~~
```
[R/mbd_sim.R:250:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L250) *style:* **Lines should not be more than 80 characters.**
```r
          L[new_interval, 1] <- t#-(delta_n:1)*1e-5 add this if you need separate time points
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:252:50:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L252) *style:* **Put spaces around all infix operators.**
```r
          L[new_interval, 3] <- abs(new_interval)*sign(parents)
                                                ~^~
```
[R/mbd_sim.R:254:44:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L254) *style:* **Put spaces around all infix operators.**
```r
          pool <- c(pool, abs(new_interval)*sign(parents))
                                          ~^~
```
[R/mbd_sim.R:255:37:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L255) *style:* **Put spaces around all infix operators.**
```r
          total_count <- total_count+delta_n
                                   ~^~
```
[R/mbd_sim.R:259:51:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L259) *style:* **Put spaces around all infix operators.**
```r
            dead <- sample(pool, replace = F, size=1)
                                                 ~^~
```
[R/mbd_sim.R:264:28:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L264) *style:* **Put spaces around all infix operators.**
```r
          pool <- pool[pool!=dead]
                          ~^~~
```
[R/mbd_sim.R:268:5:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L268) *style:* **Variable or function name should be snake_case.**
```r
    L=L[(1:total_count), ]
    ^
```
[R/mbd_sim.R:268:6:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L268) *style:* **Use <-, not =, for assignment.**
```r
    L=L[(1:total_count), ]
     ^
```
[R/mbd_sim.R:268:6:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L268) *style:* **Put spaces around all infix operators.**
```r
    L=L[(1:total_count), ]
    ~^~
```
[R/mbd_sim.R:269:21:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L269) *style:* **Use <-, not =, for assignment.**
```r
    extinct_species = sum(L[, 4]!=-1)
                    ^
```
[R/mbd_sim.R:269:33:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L269) *style:* **Put spaces around all infix operators.**
```r
    extinct_species = sum(L[, 4]!=-1)
                               ~^~~
```
[R/mbd_sim.R:271:9:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L271) *style:* **Use <-, not =, for assignment.**
```r
    tips=length(L[, 4][L[, 4]==-1])
        ^
```
[R/mbd_sim.R:271:9:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L271) *style:* **Put spaces around all infix operators.**
```r
    tips=length(L[, 4][L[, 4]==-1])
       ~^~
```
[R/mbd_sim.R:271:30:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L271) *style:* **Put spaces around all infix operators.**
```r
    tips=length(L[, 4][L[, 4]==-1])
                            ~^~~
```
[R/mbd_sim.R:273:10:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L273) *style:* **Use <-, not =, for assignment.**
```r
    alive=L[L[, 4]==-1, ]
         ^
```
[R/mbd_sim.R:273:10:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L273) *style:* **Put spaces around all infix operators.**
```r
    alive=L[L[, 4]==-1, ]
        ~^~
```
[R/mbd_sim.R:273:19:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L273) *style:* **Put spaces around all infix operators.**
```r
    alive=L[L[, 4]==-1, ]
                 ~^~~
```
[R/mbd_sim.R:274:10:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L274) *style:* **Use <-, not =, for assignment.**
```r
    alive=matrix(alive, ncol=4)
         ^
```
[R/mbd_sim.R:274:10:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L274) *style:* **Put spaces around all infix operators.**
```r
    alive=matrix(alive, ncol=4)
        ~^~
```
[R/mbd_sim.R:274:29:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L274) *style:* **Put spaces around all infix operators.**
```r
    alive=matrix(alive, ncol=4)
                           ~^~
```
[R/mbd_sim.R:275:30:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L275) *style:* **Use <-, not =, for assignment.**
```r
    conditioning_on_survival = ( length( unique(sign(alive[, 3])))!=2 )*cond
                             ^
```
[R/mbd_sim.R:275:33:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L275) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
    conditioning_on_survival = ( length( unique(sign(alive[, 3])))!=2 )*cond
                                ^
```
[R/mbd_sim.R:275:41:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L275) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
    conditioning_on_survival = ( length( unique(sign(alive[, 3])))!=2 )*cond
                                        ^
```
[R/mbd_sim.R:275:67:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L275) *style:* **Put spaces around all infix operators.**
```r
    conditioning_on_survival = ( length( unique(sign(alive[, 3])))!=2 )*cond
                                                                 ~^~~
```
[R/mbd_sim.R:275:70:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L275) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
    conditioning_on_survival = ( length( unique(sign(alive[, 3])))!=2 )*cond
                                                                     ^
```
[R/mbd_sim.R:275:72:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L275) *style:* **Put spaces around all infix operators.**
```r
    conditioning_on_survival = ( length( unique(sign(alive[, 3])))!=2 )*cond
                                                                      ~^~
```
[R/mbd_sim.R:278:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L278) *style:* **Lines should not be more than 80 characters.**
```r
    births.reconstructed_tree=unlist(unname(sort(DDD::L2brts(L, dropextinct = T), decreasing = T)))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:278:5:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L278) *style:* **Variable or function name should be snake_case.**
```r
    births.reconstructed_tree=unlist(unname(sort(DDD::L2brts(L, dropextinct = T), decreasing = T)))
    ^~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:278:30:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L278) *style:* **Use <-, not =, for assignment.**
```r
    births.reconstructed_tree=unlist(unname(sort(DDD::L2brts(L, dropextinct = T), decreasing = T)))
                             ^
```
[R/mbd_sim.R:278:30:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L278) *style:* **Put spaces around all infix operators.**
```r
    births.reconstructed_tree=unlist(unname(sort(DDD::L2brts(L, dropextinct = T), decreasing = T)))
                            ~^~
```
[R/mbd_sim.R:279:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L279) *style:* **Lines should not be more than 80 characters.**
```r
    births.full_tree=unlist(unname(sort(DDD::L2brts(L, dropextinct = F), decreasing = T)))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:279:5:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L279) *style:* **Variable or function name should be snake_case.**
```r
    births.full_tree=unlist(unname(sort(DDD::L2brts(L, dropextinct = F), decreasing = T)))
    ^~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:279:21:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L279) *style:* **Use <-, not =, for assignment.**
```r
    births.full_tree=unlist(unname(sort(DDD::L2brts(L, dropextinct = F), decreasing = T)))
                    ^
```
[R/mbd_sim.R:279:21:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L279) *style:* **Put spaces around all infix operators.**
```r
    births.full_tree=unlist(unname(sort(DDD::L2brts(L, dropextinct = F), decreasing = T)))
                   ~^~
```
[R/mbd_sim.R:280:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L280) *style:* **Lines should not be more than 80 characters.**
```r
    multiple_births.reconstructed_tree = sum( duplicated(births.reconstructed_tree))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:280:5:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L280) *style:* **Variable and function names should not be longer than 30 characters.**
```r
    multiple_births.reconstructed_tree = sum( duplicated(births.reconstructed_tree))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:280:5:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L280) *style:* **Variable or function name should be snake_case.**
```r
    multiple_births.reconstructed_tree = sum( duplicated(births.reconstructed_tree))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:280:40:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L280) *style:* **Use <-, not =, for assignment.**
```r
    multiple_births.reconstructed_tree = sum( duplicated(births.reconstructed_tree))
                                       ^
```
[R/mbd_sim.R:280:46:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L280) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
    multiple_births.reconstructed_tree = sum( duplicated(births.reconstructed_tree))
                                             ^
```
[R/mbd_sim.R:281:5:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L281) *style:* **Variable or function name should be snake_case.**
```r
    multiple_births.full_tree = sum( duplicated(births.full_tree))
    ^~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:281:5:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L281) *warning:* **local variable ‘multiple_births.full_tree’ assigned but may not be used**
```r
    multiple_births.full_tree = sum( duplicated(births.full_tree))
    ^~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:281:31:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L281) *style:* **Use <-, not =, for assignment.**
```r
    multiple_births.full_tree = sum( duplicated(births.full_tree))
                              ^
```
[R/mbd_sim.R:281:37:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L281) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
    multiple_births.full_tree = sum( duplicated(births.full_tree))
                                    ^
```
[R/mbd_sim.R:283:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L283) *style:* **Lines should not be more than 80 characters.**
```r
    # multiple_births_check = (multiple_births.full_tree>=minimum_multiple_births)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:283:7:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L283) *style:* **Commented code should be removed.**
```r
    # multiple_births_check = (multiple_births.full_tree>=minimum_multiple_births)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:284:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L284) *style:* **Lines should not be more than 80 characters.**
```r
    multiple_births_check = (multiple_births.reconstructed_tree>=minimum_multiple_births)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:284:27:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L284) *style:* **Use <-, not =, for assignment.**
```r
    multiple_births_check = (multiple_births.reconstructed_tree>=minimum_multiple_births)
                          ^
```
[R/mbd_sim.R:284:64:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L284) *style:* **Put spaces around all infix operators.**
```r
    multiple_births_check = (multiple_births.reconstructed_tree>=minimum_multiple_births)
                                                              ~^~~
```
[R/mbd_sim.R:286:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L286) *style:* **Lines should not be more than 80 characters.**
```r
  time_points=unlist(unname(sort(DDD::L2brts(L, dropextinct = T), decreasing = T)))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:286:14:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L286) *style:* **Use <-, not =, for assignment.**
```r
  time_points=unlist(unname(sort(DDD::L2brts(L, dropextinct = T), decreasing = T)))
             ^
```
[R/mbd_sim.R:286:14:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L286) *style:* **Put spaces around all infix operators.**
```r
  time_points=unlist(unname(sort(DDD::L2brts(L, dropextinct = T), decreasing = T)))
            ~^~
```
[R/mbd_sim.R:287:8:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L287) *style:* **Use <-, not =, for assignment.**
```r
  brts = -sort(abs(as.numeric(time_points)), decreasing = TRUE)
       ^
```
[R/mbd_sim.R:288:7:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L288) *style:* **Use <-, not =, for assignment.**
```r
  tes = DDD::L2phylo(L, dropextinct = T)
      ^
```
[R/mbd_sim.R:289:7:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L289) *style:* **Use <-, not =, for assignment.**
```r
  tas = DDD::L2phylo(L, dropextinct = F)
      ^
```
[R/mbd_sim.R:290:7:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L290) *style:* **Commented code should be removed.**
```r
  #   graphics::plot(tas)
      ^~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:291:7:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L291) *style:* **Commented code should be removed.**
```r
  #   graphics::plot(tes)
      ^~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:304:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L304) *style:* **Lines should not be more than 80 characters.**
```r
#' @title Creates a full simulated dataset of trees under the multiple birth death process
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:305:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L305) *style:* **Lines should not be more than 80 characters.**
```r
#' @description mbd_sim_dataset produces a full dataset of max_sims simulated trees including multiple speciations at the same time. This second version takes into account the possibility both of allopatric and sympatric speciation.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:307:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L307) *style:* **Lines should not be more than 80 characters.**
```r
#' @param edge the program automatically detects the (estimated) average number of tips. "edge" defines the width of the spread around the mean.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:308:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L308) *style:* **Lines should not be more than 80 characters.**
```r
#' @return The function returns a list of brts vectors, one for each of the max_sims simulations.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:309:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L309) *style:* **Lines should not be more than 80 characters.**
```r
#' It also saves those in a file called "sim_data" and saves all the settings in a "general_settings" file.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:314:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L314) *style:* **Lines should not be more than 80 characters.**
```r
#' # out <- mbd_sim_dataset( pars=c(0.4, 0.1, 0.2, 0.15), soc=2, age=10, cond=1, edge=Inf )
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:328:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L328) *style:* **Lines should not be more than 80 characters.**
```r
  #"edge" gives the extent of fluctuations around the mean that i want to consider
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:338:3:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L338) *style:* **Opening curly braces should never go on their own line and should always be followed by a new line.**
```r
  {
  ^
```
[R/mbd_sim.R:349:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L349) *style:* **Lines should not be more than 80 characters.**
```r
    tips_interval <- c(min_tips, max_tips) #c(10, 45) #setting the upper limit over 50 may be a problem #min and max number of tips for simulated trees
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:349:45:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L349) *style:* **Commented code should be removed.**
```r
    tips_interval <- c(min_tips, max_tips) #c(10, 45) #setting the upper limit over 50 may be a problem #min and max number of tips for simulated trees
                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:356:3:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L356) *style:* **Opening curly braces should never go on their own line and should always be followed by a new line.**
```r
  {
  ^
```
[R/mbd_sim.R:359:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L359) *style:* **Lines should not be more than 80 characters.**
```r
                                tips_interval = tips_interval, minimum_multiple_births = minimum_multiple_births)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:366:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L366) *style:* **Lines should not be more than 80 characters.**
```r
  max_k <- (init_n_lineages - 1) + (is.list(sim_data)) * max(sapply(sim_data, length)) + (1 - is.list(sim_data)) * length(sim_data)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:368:3:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L368) *style:* **Opening curly braces should never go on their own line and should always be followed by a new line.**
```r
  {
  ^
```
[R/mbd_sim.R:369:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L369) *style:* **Lines should not be more than 80 characters.**
```r
    all_the_births=sapply(sim_data, FUN = function(brts){return(brts2time_intervals_and_births(brts)$births)})
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:369:19:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L369) *style:* **Use <-, not =, for assignment.**
```r
    all_the_births=sapply(sim_data, FUN = function(brts){return(brts2time_intervals_and_births(brts)$births)})
                  ^
```
[R/mbd_sim.R:369:19:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L369) *style:* **Put spaces around all infix operators.**
```r
    all_the_births=sapply(sim_data, FUN = function(brts){return(brts2time_intervals_and_births(brts)$births)})
                 ~^~
```
[R/mbd_sim.R:369:57:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L369) *style:* **Opening curly braces should never go on their own line and should always be followed by a new line.**
```r
    all_the_births=sapply(sim_data, FUN = function(brts){return(brts2time_intervals_and_births(brts)$births)})
                                                        ^
```
[R/mbd_sim.R:369:65:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L369) *warning:* **no visible global function definition for ‘brts2time_intervals_and_births’**
```r
    all_the_births=sapply(sim_data, FUN = function(brts){return(brts2time_intervals_and_births(brts)$births)})
                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:371:19:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L371) *style:* **Use <-, not =, for assignment.**
```r
    all_the_births=brts2time_intervals_and_births(sim_data)$births
                  ^
```
[R/mbd_sim.R:371:19:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L371) *style:* **Put spaces around all infix operators.**
```r
    all_the_births=brts2time_intervals_and_births(sim_data)$births
                 ~^~
```
[R/mbd_sim.R:371:20:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L371) *warning:* **no visible global function definition for ‘brts2time_intervals_and_births’**
```r
    all_the_births=brts2time_intervals_and_births(sim_data)$births
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:377:3:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L377) *style:* **Opening curly braces should never go on their own line and should always be followed by a new line.**
```r
  {
  ^
```
[R/mbd_sim.R:382:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L382) *style:* **Lines should not be more than 80 characters.**
```r
  # simpath=paste("sims /", sim_pars[1], "-", sim_pars[2], "-", sim_pars[3], "-", sim_pars[4], "/", sep = '')
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:382:5:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L382) *style:* **Commented code should be removed.**
```r
  # simpath=paste("sims /", sim_pars[1], "-", sim_pars[2], "-", sim_pars[3], "-", sim_pars[4], "/", sep = '')
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:388:34:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L388) *style:* **Opening curly braces should never go on their own line and should always be followed by a new line.**
```r
  if (file.exists(sim_data_name)){suppressWarnings( file.remove(sim_data_name))}
                                 ^
```
[R/mbd_sim.R:388:52:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L388) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
  if (file.exists(sim_data_name)){suppressWarnings( file.remove(sim_data_name))}
                                                   ^
```
[R/mbd_sim.R:388:80:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L388) *style:* **Closing curly-braces should always be on their own line, unless it's followed by an else.**
```r
  if (file.exists(sim_data_name)){suppressWarnings( file.remove(sim_data_name))}
                                                                               ^
```
[R/mbd_sim.R:390:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L390) *style:* **Lines should not be more than 80 characters.**
```r
  if (file.exists(general_settings_name)){suppressWarnings( file.remove(general_settings_name))}
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:390:42:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L390) *style:* **Opening curly braces should never go on their own line and should always be followed by a new line.**
```r
  if (file.exists(general_settings_name)){suppressWarnings( file.remove(general_settings_name))}
                                         ^
```
[R/mbd_sim.R:390:60:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L390) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
  if (file.exists(general_settings_name)){suppressWarnings( file.remove(general_settings_name))}
                                                           ^
```
[R/mbd_sim.R:390:96:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L390) *style:* **Closing curly-braces should always be on their own line, unless it's followed by an else.**
```r
  if (file.exists(general_settings_name)){suppressWarnings( file.remove(general_settings_name))}
                                                                                ^
```
[R/mbd_sim.R:391:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L391) *style:* **Lines should not be more than 80 characters.**
```r
  save(sim_pars, soc, age, cond, max_sims, tips_interval, max_k, max_b, ext_species, additional_species, tips, minimum_multiple_births, file=general_settings_name)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:391:141:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L391) *style:* **Put spaces around all infix operators.**
```r
  save(sim_pars, soc, age, cond, max_sims, tips_interval, max_k, max_b, ext_species, additional_species, tips, minimum_multiple_births, file=general_settings_name)
                                                                                ~^~
```
[R/mbd_sim.R:392:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L392) *style:* **Lines should not be more than 80 characters.**
```r
  if (file.exists(sim_trees_name)){suppressWarnings( file.remove(sim_trees_name))}
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_sim.R:392:35:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L392) *style:* **Opening curly braces should never go on their own line and should always be followed by a new line.**
```r
  if (file.exists(sim_trees_name)){suppressWarnings( file.remove(sim_trees_name))}
                                  ^
```
[R/mbd_sim.R:392:53:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L392) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
  if (file.exists(sim_trees_name)){suppressWarnings( file.remove(sim_trees_name))}
                                                    ^
```
[R/mbd_sim.R:392:82:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_sim.R#L392) *style:* **Closing curly-braces should always be on their own line, unless it's followed by an else.**
```r
  if (file.exists(sim_trees_name)){suppressWarnings( file.remove(sim_trees_name))}
                                                                                ^
```
[R/mbd_utils.R:20:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_utils.R#L20) *style:* **Lines should not be more than 80 characters.**
```r
  n_pars=length(sim_pars);#pars_interval=list(c(0, quantile(results[, 1],.95)), c(0, quantile(results[, 2],.95)), c(0, quantile(results[, 3],.95)))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_utils.R:20:9:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_utils.R#L20) *style:* **Use <-, not =, for assignment.**
```r
  n_pars=length(sim_pars);#pars_interval=list(c(0, quantile(results[, 1],.95)), c(0, quantile(results[, 2],.95)), c(0, quantile(results[, 3],.95)))
        ^
```
[R/mbd_utils.R:20:9:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_utils.R#L20) *style:* **Put spaces around all infix operators.**
```r
  n_pars=length(sim_pars);#pars_interval=list(c(0, quantile(results[, 1],.95)), c(0, quantile(results[, 2],.95)), c(0, quantile(results[, 3],.95)))
       ~^~
```
[R/mbd_utils.R:20:28:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_utils.R#L20) *style:* **Commented code should be removed.**
```r
  n_pars=length(sim_pars);#pars_interval=list(c(0, quantile(results[, 1],.95)), c(0, quantile(results[, 2],.95)), c(0, quantile(results[, 3],.95)))
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_utils.R:21:26:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_utils.R#L21) *style:* **Opening curly braces should never go on their own line and should always be followed by a new line.**
```r
  if (missing(idparsopt)){estimated_pars=1:n_pars}else{estimated_pars=idparsopt}
                         ^
```
[R/mbd_utils.R:21:41:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_utils.R#L21) *style:* **Use <-, not =, for assignment.**
```r
  if (missing(idparsopt)){estimated_pars=1:n_pars}else{estimated_pars=idparsopt}
                                        ^
```
[R/mbd_utils.R:21:41:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_utils.R#L21) *style:* **Put spaces around all infix operators.**
```r
  if (missing(idparsopt)){estimated_pars=1:n_pars}else{estimated_pars=idparsopt}
                                       ~^~
```
[R/mbd_utils.R:21:50:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_utils.R#L21) *style:* **Closing curly-braces should always be on their own line, unless it's followed by an else.**
```r
  if (missing(idparsopt)){estimated_pars=1:n_pars}else{estimated_pars=idparsopt}
                                                 ^
```
[R/mbd_utils.R:21:55:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_utils.R#L21) *style:* **Opening curly braces should never go on their own line and should always be followed by a new line.**
```r
  if (missing(idparsopt)){estimated_pars=1:n_pars}else{estimated_pars=idparsopt}
                                                      ^
```
[R/mbd_utils.R:21:70:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_utils.R#L21) *style:* **Use <-, not =, for assignment.**
```r
  if (missing(idparsopt)){estimated_pars=1:n_pars}else{estimated_pars=idparsopt}
                                                                     ^
```
[R/mbd_utils.R:21:70:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_utils.R#L21) *style:* **Put spaces around all infix operators.**
```r
  if (missing(idparsopt)){estimated_pars=1:n_pars}else{estimated_pars=idparsopt}
                                                                    ~^~
```
[R/mbd_utils.R:21:80:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_utils.R#L21) *style:* **Closing curly-braces should always be on their own line, unless it's followed by an else.**
```r
  if (missing(idparsopt)){estimated_pars=1:n_pars}else{estimated_pars=idparsopt}
                                                                               ^
```
[R/mbd_utils.R:22:13:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_utils.R#L22) *style:* **Use <-, not =, for assignment.**
```r
  par_names = colnames(results)[1:n_pars]
            ^
```
[R/mbd_utils.R:24:1:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_utils.R#L24) *style:* **Lines should not be more than 80 characters.**
```r
  truevalues_color="red"; points_color = "azure4"; medians_color = "blue3"#"chartreuse3";
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/mbd_utils.R:24:19:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_utils.R#L24) *style:* **Use <-, not =, for assignment.**
```r
  truevalues_color="red"; points_color = "azure4"; medians_color = "blue3"#"chartreuse3";
                  ^
```
[R/mbd_utils.R:24:19:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_utils.R#L24) *style:* **Put spaces around all infix operators.**
```r
  truevalues_color="red"; points_color = "azure4"; medians_color = "blue3"#"chartreuse3";
                 ~^~
```
[R/mbd_utils.R:24:40:](https://github.com/Giappo/mbd/blob/268ac000a2190b44cccf4403ea75cb38416e3383/R/mbd_utils.R#L24) *style:* **Use <-, not =, for assignment.**
```r
  truevalues_color="red"; points_color = "azure4"; medians_color = "blue3"#"chartreuse3";
                                       ^
```


И ты хранишь номера в строке через запятую, а сплитишь по пробелу


would rather eliminate the explanation part (and, definitely, words like `unfortunately` and `unreliable` - this immediately raises question like 'what is the aspect it becomes unreliable for?', 'when it has become unreliable, starting from which version?').

If we would like to provide some reasons behind our choice, it is better to use more neutral phrases like (and not blame `npm`:):
> we are using `yarn` ... because of its [benefits](https://github.com/yarnpkg/yarn/#features).


コメント記入者：卜部
ここまでの構文を見ていると、末端の「;」は改行して記載しています。
コーディング規約等も同じですが、一定のルールに則り、表現の平仄を合わせることで可読性が向上します。SQLとしての研修規約は特にありませんが、佐和さん自身の中で、しっかりとしたルール作りをして、表現の平仄を合わせていきましょう。


I have worked on profile page to show the profile details. Also worked on show the list of users who are registered to the site.


![](https://github.trello.services/images/mini-trello-icon.png) [Foreign keys in database](https://trello.com/c/ngaMnx9t/247-foreign-keys-in-database)