Closed richelbilderbeek closed 5 years ago
R/bd_loglik_choosepar.R:1:1: style: Lines should not be more than 80 characters.
bd_loglik_choosepar = function(trparsopt,trparsfix,idparsopt,idparsfix,pars2,brts,missnumspec,methode)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R/bd_loglik_choosepar.R:1:21: style: Use <-, not =, for assignment.
bd_loglik_choosepar = function(trparsopt,trparsfix,idparsopt,idparsfix,pars2,brts,missnumspec,methode)
^
R/bd_loglik_choosepar.R:1:42: style: Commas should always have a space after.
bd_loglik_choosepar = function(trparsopt,trparsfix,idparsopt,idparsfix,pars2,brts,missnumspec,methode)
^
R/bd_loglik_choosepar.R:1:52: style: Commas should always have a space after.
bd_loglik_choosepar = function(trparsopt,trparsfix,idparsopt,idparsfix,pars2,brts,missnumspec,methode)
^
R/bd_loglik_choosepar.R:1:62: style: Commas should always have a space after.
bd_loglik_choosepar = function(trparsopt,trparsfix,idparsopt,idparsfix,pars2,brts,missnumspec,methode)
^
R/bd_loglik_choosepar.R:1:72: style: Commas should always have a space after.
bd_loglik_choosepar = function(trparsopt,trparsfix,idparsopt,idparsfix,pars2,brts,missnumspec,methode)
^
R/bd_loglik_choosepar.R:1:78: style: Commas should always have a space after.
bd_loglik_choosepar = function(trparsopt,trparsfix,idparsopt,idparsfix,pars2,brts,missnumspec,methode)
^
R/bd_loglik_choosepar.R:1:83: style: Commas should always have a space after.
bd_loglik_choosepar = function(trparsopt,trparsfix,idparsopt,idparsfix,pars2,brts,missnumspec,methode)
^
R/bd_loglik_choosepar.R:1:95: style: Commas should always have a space after.
bd_loglik_choosepar = function(trparsopt,trparsfix,idparsopt,idparsfix,pars2,brts,missnumspec,methode)
^
R/bd_loglik_choosepar.R:2:1: style: Opening curly braces should never go on their own line and should always be followed by a new line.
{
^
R/bd_loglik_choosepar.R:3:12: style: Use <-, not =, for assignment.
trpars1 = rep(0,4)
^
R/bd_loglik_choosepar.R:3:20: style: Commas should always have a space after.
trpars1 = rep(0,4)
^
R/bd_loglik_choosepar.R:4:23: style: Use <-, not =, for assignment.
trpars1[idparsopt] = trparsopt
^
R/bd_loglik_choosepar.R:5:6: style: Place a space before left parenthesis, except in a function call.
if(length(idparsfix) != 0)
^
R/bd_loglik_choosepar.R:6:4: style: Opening curly braces should never go on their own line and should always be followed by a new line.
{
^
R/bd_loglik_choosepar.R:7:26: style: Use <-, not =, for assignment.
trpars1[idparsfix] = trparsfix
^
R/bd_loglik_choosepar.R:9:6: style: Place a space before left parenthesis, except in a function call.
if(max(trpars1) > 1 | min(trpars1) < 0)
^
R/bd_loglik_choosepar.R:10:4: style: Opening curly braces should never go on their own line and should always be followed by a new line.
{
^
R/bd_loglik_choosepar.R:11:14: style: Use <-, not =, for assignment.
loglik = -Inf
^
R/bd_loglik_choosepar.R:13:13: style: Use <-, not =, for assignment.
pars1 = trpars1/(1 - trpars1)
^
R/bd_loglik_choosepar.R:13:22: style: Put spaces around all infix operators.
pars1 = trpars1/(1 - trpars1)
~^~
R/bd_loglik_choosepar.R:13:23: style: Place a space before left parenthesis, except in a function call.
pars1 = trpars1/(1 - trpars1)
^
R/bd_loglik_choosepar.R:14:1: style: Lines should not be more than 80 characters.
loglik = bd_loglik(pars1 = pars1,pars2 = pars2[1:6],brts = brts,missnumspec = missnumspec, methode = methode)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R/bd_loglik_choosepar.R:14:14: style: Use <-, not =, for assignment.
loglik = bd_loglik(pars1 = pars1,pars2 = pars2[1:6],brts = brts,missnumspec = missnumspec, methode = methode)
^
R/bd_loglik_choosepar.R:14:16: warning: no visible global function definition for ‘bd_loglik’
loglik = bd_loglik(pars1 = pars1,pars2 = pars2[1:6],brts = brts,missnumspec = missnumspec, methode = methode)
^~~~~~~~~
R/bd_loglik_choosepar.R:14:40: style: Commas should always have a space after.
loglik = bd_loglik(pars1 = pars1,pars2 = pars2[1:6],brts = brts,missnumspec = missnumspec, methode = methode)
^
R/bd_loglik_choosepar.R:14:59: style: Commas should always have a space after.
loglik = bd_loglik(pars1 = pars1,pars2 = pars2[1:6],brts = brts,missnumspec = missnumspec, methode = methode)
^
R/bd_loglik_choosepar.R:14:71: style: Commas should always have a space after.
loglik = bd_loglik(pars1 = pars1,pars2 = pars2[1:6],brts = brts,missnumspec = missnumspec, methode = methode)
^
R/bd_loglik_choosepar.R:15:9: style: Place a space before left parenthesis, except in a function call.
if(is.nan(loglik) || is.na(loglik))
^
R/bd_loglik_choosepar.R:16:7: style: Opening curly braces should never go on their own line and should always be followed by a new line.
{
^
R/bd_loglik_choosepar.R:17:1: style: Lines should not be more than 80 characters.
cat("There are parameter values used which cause numerical problems.\n")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R/bd_loglik_choosepar.R:18:17: style: Use <-, not =, for assignment.
loglik = -Inf
^
R/bd_loglik.R:2:3: style: Trailing whitespace is superfluous.
#'
^
R/bd_loglik.R:6:3: style: Trailing whitespace is superfluous.
#'
^
R/bd_loglik.R:7:3: style: Trailing whitespace is superfluous.
#'
^
R/bd_loglik.R:41:1: style: Lines should not be more than 80 characters.
#' \cr \cr \code{pars2[4]} sets whether the parameters and likelihood should be shown
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R/bd_loglik.R:58:1: style: Lines should not be more than 80 characters.
#' bd_loglik(pars1 = c(0.5,0.1), pars2 = c(0,1,1,0,2), brts = 1:10, missnumspec = 0)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R/bd_loglik.R:58:85: style: Trailing whitespace is superfluous.
#' bd_loglik(pars1 = c(0.5,0.1), pars2 = c(0,1,1,0,2), brts = 1:10, missnumspec = 0)
^
R/bd_loglik.R:60:11: style: Use <-, not =, for assignment.
bd_loglik = function(pars1,pars2,brts,missnumspec,methode = 'lsoda')
^
R/bd_loglik.R:60:28: style: Commas should always have a space after.
bd_loglik = function(pars1,pars2,brts,missnumspec,methode = 'lsoda')
^
R/bd_loglik.R:60:34: style: Commas should always have a space after.
bd_loglik = function(pars1,pars2,brts,missnumspec,methode = 'lsoda')
^
R/bd_loglik.R:60:39: style: Commas should always have a space after.
bd_loglik = function(pars1,pars2,brts,missnumspec,methode = 'lsoda')
^
R/bd_loglik.R:60:51: style: Commas should always have a space after.
bd_loglik = function(pars1,pars2,brts,missnumspec,methode = 'lsoda')
^
R/bd_loglik.R:60:61: style: Only use double-quotes.
bd_loglik = function(pars1,pars2,brts,missnumspec,methode = 'lsoda')
^~~~~~~
R/bd_loglik.R:64:1: style: Lines should not be more than 80 characters.
# - pars1[3] = la1 = parameter in exponential decay of speciation rate, OR K in diversity-dependence-like models (default 0)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R/bd_loglik.R:65:1: style: Lines should not be more than 80 characters.
# - pars1[4] = mu1 = parameter in exponential decay of extinction rate (default 0)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R/bd_loglik.R:66:1: style: Lines should not be more than 80 characters.
# - pars1[5] = T0 = age at which lambda is lambda0 (default T0 = age of phylogeny)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R/bd_loglik.R:71:1: style: Lines should not be more than 80 characters.
# . tdmodel == 2: stepwise decline following diversity-dependence when extinction = 0
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R/bd_loglik.R:72:1: style: Lines should not be more than 80 characters.
# . tdmodel == 3: decline in speciation rate following deterministic logistic equation for ddmodel = 1
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R/bd_loglik.R:73:1: style: Lines should not be more than 80 characters.
# . tdmodel == 4...8: change in speciation/extinction rate following ddmodel = 1...5, with n = expected number of species
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R/bd_loglik.R:74:1: style: Lines should not be more than 80 characters.
# - pars2[2] = cond = conditioning on age (0), non-extinction of the clade and age (1), number of taxa and age (2), number of taxa (3)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R/bd_loglik.R:77:1: style: Lines should not be more than 80 characters.
# - pars2[5] = likelihood is for a tree with crown age (2) or stem age (1) - stem age not yet implemented for tdmodel == 2
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R/bd_loglik.R:80:1: style: Opening curly braces should never go on their own line and should always be followed by a new line.
{
^
R/bd_loglik.R:81:11: style: Use <-, not =, for assignment.
rhotaut = function(tau,t1,pars)
^
R/bd_loglik.R:81:26: style: Commas should always have a space after.
rhotaut = function(tau,t1,pars)
^
R/bd_loglik.R:81:29: style: Commas should always have a space after.
rhotaut = function(tau,t1,pars)
^
R/bd_loglik.R:82:3: style: Opening curly braces should never go on their own line and should always be followed by a new line.
{
^
R/bd_loglik.R:83:9: style: Use <-, not =, for assignment.
la0 = pars[1]
^
R/bd_loglik.R:84:9: style: Use <-, not =, for assignment.
mu0 = pars[2]
^
R/bd_loglik.R:85:9: style: Use <-, not =, for assignment.
la1 = pars[3]
^
R/bd_loglik.R:86:9: style: Use <-, not =, for assignment.
mu1 = pars[4]
^
R/bd_loglik.R:86:18: style: Trailing whitespace is superfluous.
mu1 = pars[4]
^~
R/bd_loglik.R:87:7: style: Place a space before left parenthesis, except in a function call.
if(la1 == 0 & mu1 == 0) {rtt = mu0 * (tau - t1) - la0 * (tau - t1)}
^
R/bd_loglik.R:87:29: style: Opening curly braces should never go on their own line and should always be followed by a new line.
if(la1 == 0 & mu1 == 0) {rtt = mu0 * (tau - t1) - la0 * (tau - t1)}
^
R/bd_loglik.R:87:34: style: Use <-, not =, for assignment.
if(la1 == 0 & mu1 == 0) {rtt = mu0 * (tau - t1) - la0 * (tau - t1)}
^
R/bd_loglik.R:87:71: style: Closing curly-braces should always be on their own line, unless it's followed by an else.
if(la1 == 0 & mu1 == 0) {rtt = mu0 * (tau - t1) - la0 * (tau - t1)}
^
R/bd_loglik.R:88:1: style: Lines should not be more than 80 characters.
if(la1 > 0 & mu1 == 0) {rtt = mu0 * (tau - t1) - la0/la1 * (exp(-la1*t1) - exp(-la1*tau))}
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R/bd_loglik.R:88:7: style: Place a space before left parenthesis, except in a function call.
if(la1 > 0 & mu1 == 0) {rtt = mu0 * (tau - t1) - la0/la1 * (exp(-la1*t1) - exp(-la1*tau))}
^
R/bd_loglik.R:88:28: style: Opening curly braces should never go on their own line and should always be followed by a new line.
if(la1 > 0 & mu1 == 0) {rtt = mu0 * (tau - t1) - la0/la1 * (exp(-la1*t1) - exp(-la1*tau))}
^
R/bd_loglik.R:88:33: style: Use <-, not =, for assignment.
if(la1 > 0 & mu1 == 0) {rtt = mu0 * (tau - t1) - la0/la1 * (exp(-la1*t1) - exp(-la1*tau))}
^
R/bd_loglik.R:88:57: style: Put spaces around all infix operators.
if(la1 > 0 & mu1 == 0) {rtt = mu0 * (tau - t1) - la0/la1 * (exp(-la1*t1) - exp(-la1*tau))}
~^~
R/bd_loglik.R:88:73: style: Put spaces around all infix operators.
if(la1 > 0 & mu1 == 0) {rtt = mu0 * (tau - t1) - la0/la1 * (exp(-la1*t1) - exp(-la1*tau))}
~^~
R/bd_loglik.R:88:88: style: Put spaces around all infix operators.
if(la1 > 0 & mu1 == 0) {rtt = mu0 * (tau - t1) - la0/la1 * (exp(-la1*t1) - exp(-la1*tau))}
~^~
R/bd_loglik.R:88:94: style: Closing curly-braces should always be on their own line, unless it's followed by an else.
if(la1 > 0 & mu1 == 0) {rtt = mu0 * (tau - t1) - la0/la1 * (exp(-la1*t1) - exp(-la1*tau))}
^
R/bd_loglik.R:89:1: style: Lines should not be more than 80 characters.
if(la1 == 0 & mu1 > 0) {rtt = mu0/mu1 * (exp(-mu1*t1) - exp(-mu1*tau)) - la0 * (tau - t1)}
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R/bd_loglik.R:89:7: style: Place a space before left parenthesis, except in a function call.
if(la1 == 0 & mu1 > 0) {rtt = mu0/mu1 * (exp(-mu1*t1) - exp(-mu1*tau)) - la0 * (tau - t1)}
^
R/bd_loglik.R:89:28: style: Opening curly braces should never go on their own line and should always be followed by a new line.
if(la1 == 0 & mu1 > 0) {rtt = mu0/mu1 * (exp(-mu1*t1) - exp(-mu1*tau)) - la0 * (tau - t1)}
^
R/bd_loglik.R:89:33: style: Use <-, not =, for assignment.
if(la1 == 0 & mu1 > 0) {rtt = mu0/mu1 * (exp(-mu1*t1) - exp(-mu1*tau)) - la0 * (tau - t1)}
^
R/bd_loglik.R:89:38: style: Put spaces around all infix operators.
if(la1 == 0 & mu1 > 0) {rtt = mu0/mu1 * (exp(-mu1*t1) - exp(-mu1*tau)) - la0 * (tau - t1)}
~^~
R/bd_loglik.R:89:54: style: Put spaces around all infix operators.
if(la1 == 0 & mu1 > 0) {rtt = mu0/mu1 * (exp(-mu1*t1) - exp(-mu1*tau)) - la0 * (tau - t1)}
~^~
R/bd_loglik.R:89:69: style: Put spaces around all infix operators.
if(la1 == 0 & mu1 > 0) {rtt = mu0/mu1 * (exp(-mu1*t1) - exp(-mu1*tau)) - la0 * (tau - t1)}
~^~
R/bd_loglik.R:89:94: style: Closing curly-braces should always be on their own line, unless it's followed by an else.
if(la1 == 0 & mu1 > 0) {rtt = mu0/mu1 * (exp(-mu1*t1) - exp(-mu1*tau)) - la0 * (tau - t1)}
^
R/bd_loglik.R:90:1: style: Lines should not be more than 80 characters.
if(la1 > 0 & mu1 > 0) {rtt = mu0/mu1 * (exp(-mu1*t1) - exp(-mu1*tau)) - la0/la1 * (exp(-la1*t1) - exp(-la1*tau))}
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R/bd_loglik.R:90:7: style: Place a space before left parenthesis, except in a function call.
if(la1 > 0 & mu1 > 0) {rtt = mu0/mu1 * (exp(-mu1*t1) - exp(-mu1*tau)) - la0/la1 * (exp(-la1*t1) - exp(-la1*tau))}
^
R/bd_loglik.R:90:27: style: Opening curly braces should never go on their own line and should always be followed by a new line.
if(la1 > 0 & mu1 > 0) {rtt = mu0/mu1 * (exp(-mu1*t1) - exp(-mu1*tau)) - la0/la1 * (exp(-la1*t1) - exp(-la1*tau))}
^
R/bd_loglik.R:90:32: style: Use <-, not =, for assignment.
if(la1 > 0 & mu1 > 0) {rtt = mu0/mu1 * (exp(-mu1*t1) - exp(-mu1*tau)) - la0/la1 * (exp(-la1*t1) - exp(-la1*tau))}
^
R/bd_loglik.R:90:37: style: Put spaces around all infix operators.
if(la1 > 0 & mu1 > 0) {rtt = mu0/mu1 * (exp(-mu1*t1) - exp(-mu1*tau)) - la0/la1 * (exp(-la1*t1) - exp(-la1*tau))}
~^~
R/bd_loglik.R:90:53: style: Put spaces around all infix operators.
if(la1 > 0 & mu1 > 0) {rtt = mu0/mu1 * (exp(-mu1*t1) - exp(-mu1*tau)) - la0/la1 * (exp(-la1*t1) - exp(-la1*tau))}
~^~
R/bd_loglik.R:90:68: style: Put spaces around all infix operators.
if(la1 > 0 & mu1 > 0) {rtt = mu0/mu1 * (exp(-mu1*t1) - exp(-mu1*tau)) - la0/la1 * (exp(-la1*t1) - exp(-la1*tau))}
~^~
R/bd_loglik.R:90:80: style: Put spaces around all infix operators.
if(la1 > 0 & mu1 > 0) {rtt = mu0/mu1 * (exp(-mu1*t1) - exp(-mu1*tau)) - la0/la1 * (exp(-la1*t1) - exp(-la1*tau))}
~^~
R/bd_loglik.R:90:96: style: Put spaces around all infix operators.
if(la1 > 0 & mu1 > 0) {rtt = mu0/mu1 * (exp(-mu1*t1) - exp(-mu1*tau)) - la0/la1 * (exp(-la1*t1) - exp(-la1*tau))}
~^~
R/bd_loglik.R:90:111: style: Put spaces around all infix operators.
if(la1 > 0 & mu1 > 0) {rtt = mu0/mu1 * (exp(-mu1*t1) - exp(-mu1*tau)) - la0/la1 * (exp(-la1*t1) - exp(-la1*tau))}
~^~
R/bd_loglik.R:90:117: style: Closing curly-braces should always be on their own line, unless it's followed by an else.
if(la1 > 0 & mu1 > 0) {rtt = mu0/mu1 * (exp(-mu1*t1) - exp(-mu1*tau)) - la0/la1 * (exp(-la1*t1) - exp(-la1*tau))}
^
R/bd_loglik.R:93:1: style: Trailing whitespace is superfluous.
^~
R/bd_loglik.R:94:3: style: Variable or function name should be snake_case.
PtTint = function(x,t1,pars)
^~~~~~
R/bd_loglik.R:94:10: style: Use <-, not =, for assignment.
PtTint = function(x,t1,pars)
^
R/bd_loglik.R:94:23: style: Commas should always have a space after.
PtTint = function(x,t1,pars)
^
R/bd_loglik.R:94:26: style: Commas should always have a space after.
PtTint = function(x,t1,pars)
^
R/bd_loglik.R:95:3: style: Opening curly braces should never go on their own line and should always be followed by a new line.
{
^
R/bd_loglik.R:95:4: style: Trailing whitespace is superfluous.
{
^
R/bd_loglik.R:96:5: style: Variable or function name should be snake_case.
PtTint = pars[2] * exp(-pars[4] * x) * exp(rhotaut(x,t1,pars))
^~~~~~
R/bd_loglik.R:96:12: style: Use <-, not =, for assignment.
PtTint = pars[2] * exp(-pars[4] * x) * exp(rhotaut(x,t1,pars))
^
R/bd_loglik.R:96:58: style: Commas should always have a space after.
PtTint = pars[2] * exp(-pars[4] * x) * exp(rhotaut(x,t1,pars))
^
R/bd_loglik.R:96:61: style: Commas should always have a space after.
PtTint = pars[2] * exp(-pars[4] * x) * exp(rhotaut(x,t1,pars))
^
R/bd_loglik.R:99:1: style: Trailing whitespace is superfluous.
^~
R/bd_loglik.R:100:6: style: Use <-, not =, for assignment.
ff = function(t1,pars)
^
R/bd_loglik.R:100:20: style: Commas should always have a space after.
ff = function(t1,pars)
^
R/bd_loglik.R:101:3: style: Opening curly braces should never go on their own line and should always be followed by a new line.
{
^
R/bd_loglik.R:102:8: style: Use <-, not =, for assignment.
ff = 1/pars[3] + (1/2 - 1/pars[3]) * exp(-(pars[1] - pars[2]) * t1)
^
R/bd_loglik.R:102:11: style: Put spaces around all infix operators.
ff = 1/pars[3] + (1/2 - 1/pars[3]) * exp(-(pars[1] - pars[2]) * t1)
~^~
R/bd_loglik.R:102:24: style: Put spaces around all infix operators.
ff = 1/pars[3] + (1/2 - 1/pars[3]) * exp(-(pars[1] - pars[2]) * t1)
~^~
R/bd_loglik.R:102:30: style: Put spaces around all infix operators.
ff = 1/pars[3] + (1/2 - 1/pars[3]) * exp(-(pars[1] - pars[2]) * t1)
~^~
R/bd_loglik.R:102:47: style: Place a space before left parenthesis, except in a function call.
ff = 1/pars[3] + (1/2 - 1/pars[3]) * exp(-(pars[1] - pars[2]) * t1)
^
R/bd_loglik.R:105:1: style: Trailing whitespace is superfluous.
^~
R/bd_loglik.R:106:15: style: Use <-, not =, for assignment.
exprhotaut2 = function(tau,t1,pars)
^
R/bd_loglik.R:106:30: style: Commas should always have a space after.
exprhotaut2 = function(tau,t1,pars)
^
R/bd_loglik.R:106:33: style: Commas should always have a space after.
exprhotaut2 = function(tau,t1,pars)
^
R/bd_loglik.R:107:3: style: Opening curly braces should never go on their own line and should always be followed by a new line.
{
^
R/bd_loglik.R:107:4: style: Trailing whitespace is superfluous.
{
^~~
R/bd_loglik.R:108:9: style: Use <-, not =, for assignment.
rtt = ff(tau,pars)/ff(t1,pars)
^
R/bd_loglik.R:108:18: style: Commas should always have a space after.
rtt = ff(tau,pars)/ff(t1,pars)
^
R/bd_loglik.R:108:23: style: Put spaces around all infix operators.
rtt = ff(tau,pars)/ff(t1,pars)
~^~
R/bd_loglik.R:108:30: style: Commas should always have a space after.
rtt = ff(tau,pars)/ff(t1,pars)
^
R/bd_loglik.R:111:1: style: Trailing whitespace is superfluous.
^~
R/bd_loglik.R:112:3: style: Variable or function name should be snake_case.
intPtTint2 = function(t1,T,pars)
^~~~~~~~~~
R/bd_loglik.R:112:14: style: Use <-, not =, for assignment.
intPtTint2 = function(t1,T,pars)
^
R/bd_loglik.R:112:28: style: Commas should always have a space after.
intPtTint2 = function(t1,T,pars)
^
R/bd_loglik.R:112:30: style: Commas should always have a space after.
intPtTint2 = function(t1,T,pars)
^
R/bd_loglik.R:113:3: style: Opening curly braces should never go on their own line and should always be followed by a new line.
{
^
R/bd_loglik.R:114:1: style: Lines should not be more than 80 characters.
intPtTint2 = pars[2]/ff(t1,pars) * ( (T - t1)/pars[3] + (ff(t1,pars) - ff(T,pars))/(pars[1] - pars[2]) )
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R/bd_loglik.R:114:5: style: Variable or function name should be snake_case.
intPtTint2 = pars[2]/ff(t1,pars) * ( (T - t1)/pars[3] + (ff(t1,pars) - ff(T,pars))/(pars[1] - pars[2]) )
^~~~~~~~~~
R/bd_loglik.R:114:16: style: Use <-, not =, for assignment.
intPtTint2 = pars[2]/ff(t1,pars) * ( (T - t1)/pars[3] + (ff(t1,pars) - ff(T,pars))/(pars[1] - pars[2]) )
^
R/bd_loglik.R:114:25: style: Put spaces around all infix operators.
intPtTint2 = pars[2]/ff(t1,pars) * ( (T - t1)/pars[3] + (ff(t1,pars) - ff(T,pars))/(pars[1] - pars[2]) )
~^~
R/bd_loglik.R:114:32: style: Commas should always have a space after.
intPtTint2 = pars[2]/ff(t1,pars) * ( (T - t1)/pars[3] + (ff(t1,pars) - ff(T,pars))/(pars[1] - pars[2]) )
^
R/bd_loglik.R:114:41: style: Do not place spaces around code in parentheses or square brackets.
intPtTint2 = pars[2]/ff(t1,pars) * ( (T - t1)/pars[3] + (ff(t1,pars) - ff(T,pars))/(pars[1] - pars[2]) )
^
R/bd_loglik.R:114:50: style: Put spaces around all infix operators.
intPtTint2 = pars[2]/ff(t1,pars) * ( (T - t1)/pars[3] + (ff(t1,pars) - ff(T,pars))/(pars[1] - pars[2]) )
~^~
R/bd_loglik.R:114:68: style: Commas should always have a space after.
intPtTint2 = pars[2]/ff(t1,pars) * ( (T - t1)/pars[3] + (ff(t1,pars) - ff(T,pars))/(pars[1] - pars[2]) )
^
R/bd_loglik.R:114:81: style: Commas should always have a space after.
intPtTint2 = pars[2]/ff(t1,pars) * ( (T - t1)/pars[3] + (ff(t1,pars) - ff(T,pars))/(pars[1] - pars[2]) )
^
R/bd_loglik.R:114:87: style: Put spaces around all infix operators.
intPtTint2 = pars[2]/ff(t1,pars) * ( (T - t1)/pars[3] + (ff(t1,pars) - ff(T,pars))/(pars[1] - pars[2]) )
~^~
R/bd_loglik.R:114:88: style: Place a space before left parenthesis, except in a function call.
intPtTint2 = pars[2]/ff(t1,pars) * ( (T - t1)/pars[3] + (ff(t1,pars) - ff(T,pars))/(pars[1] - pars[2]) )
^
R/bd_loglik.R:114:107: style: Do not place spaces around code in parentheses or square brackets.
intPtTint2 = pars[2]/ff(t1,pars) * ( (T - t1)/pars[3] + (ff(t1,pars) - ff(T,pars))/(pars[1] - pars[2]) )
^
R/bd_loglik.R:117:1: style: Trailing whitespace is superfluous.
^~
R/bd_loglik.R:118:11: style: Use <-, not =, for assignment.
tdmodel = pars2[1]
^
R/bd_loglik.R:119:5: style: Place a space before left parenthesis, except in a function call.
if(min(pars1) < 0 | (tdmodel == 4 & pars1[1] <= pars1[2]))
^
R/bd_loglik.R:120:3: style: Opening curly braces should never go on their own line and should always be followed by a new line.
{
^
R/bd_loglik.R:122:13: style: Use <-, not =, for assignment.
loglik = -Inf
^
R/bd_loglik.R:125:10: style: Use <-, not =, for assignment.
cond = pars2[2]
^
R/bd_loglik.R:126:9: style: Use <-, not =, for assignment.
soc = pars2[5]
^
R/bd_loglik.R:127:7: style: Place a space before left parenthesis, except in a function call.
if(cond == 3)
^
R/bd_loglik.R:128:5: style: Opening curly braces should never go on their own line and should always be followed by a new line.
{
^
R/bd_loglik.R:129:12: style: Use <-, not =, for assignment.
soc = 2
^
R/bd_loglik.R:131:12: style: Use <-, not =, for assignment.
btorph = pars2[3]
^
R/bd_loglik.R:132:7: style: Use <-, not =, for assignment.
m = missnumspec
^
R/bd_loglik.R:133:7: style: Place a space before left parenthesis, except in a function call.
if(is.na(pars2[6]))
^
R/bd_loglik.R:134:5: style: Opening curly braces should never go on their own line and should always be followed by a new line.
{
^
R/bd_loglik.R:135:17: style: Use <-, not =, for assignment.
pars2[6] = Inf
^
R/bd_loglik.R:136:6: style: Trailing whitespace is superfluous.
}
^~
R/bd_loglik.R:137:1: style: Trailing whitespace is superfluous.
^~~~
R/bd_loglik.R:138:7: style: Place a space before left parenthesis, except in a function call.
if(soc == 1 & tdmodel == 2)
^
R/bd_loglik.R:139:5: style: Opening curly braces should never go on their own line and should always be followed by a new line.
{
^
R/bd_loglik.R:140:1: style: Lines should not be more than 80 characters.
cat("Stem age and conditioning on extant taxa only have not yet been implemented for this model. Use dd_loglik instead\n")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R/bd_loglik.R:141:14: style: Use <-, not =, for assignment.
loglik = -Inf
^
R/bd_loglik.R:143:12: style: Opening curly braces should never go on their own line and should always be followed by a new line.
} else {
^
R/bd_loglik.R:143:13: style: Trailing whitespace is superfluous.
} else {
^~~~~~~~
R/bd_loglik.R:144:12: style: Use <-, not =, for assignment.
brts = sort(abs(as.numeric(brts)),decreasing = TRUE)
^
R/bd_loglik.R:144:41: style: Commas should always have a space after.
brts = sort(abs(as.numeric(brts)),decreasing = TRUE)
^
R/bd_loglik.R:145:9: style: Place a space before left parenthesis, except in a function call.
if(brts[length(brts)] == 0)
^
R/bd_loglik.R:146:7: style: Opening curly braces should never go on their own line and should always be followed by a new line.
{
^
R/bd_loglik.R:147:15: style: Use <-, not =, for assignment.
brts = brts[-length(brts)]
^
R/bd_loglik.R:149:13: style: Use <-, not =, for assignment.
brts2 = c(-sort(abs(as.numeric(brts)),decreasing = TRUE),0)
^
R/bd_loglik.R:149:45: style: Commas should always have a space after.
brts2 = c(-sort(abs(as.numeric(brts)),decreasing = TRUE),0)
^
R/bd_loglik.R:149:64: style: Commas should always have a space after.
brts2 = c(-sort(abs(as.numeric(brts)),decreasing = TRUE),0)
^
R/bd_loglik.R:150:10: style: Place a space before left parenthesis, except in a function call.
for(i in 2:length(brts2))
^
R/bd_loglik.R:151:7: style: Opening curly braces should never go on their own line and should always be followed by a new line.
{
^
R/bd_loglik.R:152:12: style: Place a space before left parenthesis, except in a function call.
if(brts2[i] == brts2[i - 1])
^
R/bd_loglik.R:153:10: style: Opening curly braces should never go on their own line and should always be followed by a new line.
{
^
R/bd_loglik.R:154:22: style: Use <-, not =, for assignment.
brts2[i] = brts2[i] + 1E-10
^
R/bd_loglik.R:157:9: style: Place a space before left parenthesis, except in a function call.
if(soc == 2)
^
R/bd_loglik.R:158:7: style: Opening curly braces should never go on their own line and should always be followed by a new line.
{
^
R/bd_loglik.R:159:14: style: Use <-, not =, for assignment.
brts = c(brts[1],brts)
^
R/bd_loglik.R:159:26: style: Commas should always have a space after.
brts = c(brts[1],brts)
^
R/bd_loglik.R:161:7: style: Variable or function name should be snake_case.
TT = brts[1]
^~
R/bd_loglik.R:161:10: style: Use <-, not =, for assignment.
TT = brts[1]
^
R/bd_loglik.R:162:9: style: Use <-, not =, for assignment.
t = TT - brts
^
R/bd_loglik.R:163:1: style: Trailing whitespace is superfluous.
^~~~~~
R/bd_loglik.R:164:7: style: Variable or function name should be snake_case.
S = length(brts)
^
R/bd_loglik.R:164:9: style: Use <-, not =, for assignment.
S = length(brts)
^
R/bd_loglik.R:165:7: style: Variable or function name should be snake_case.
N = S + m
^
R/bd_loglik.R:165:9: style: Use <-, not =, for assignment.
N = S + m
^
R/bd_loglik.R:166:10: style: Use <-, not =, for assignment.
np = length(brts2)
^
R/bd_loglik.R:167:7: style: Variable or function name should be snake_case.
PtT = rep(0,S)
^~~
R/bd_loglik.R:167:11: style: Use <-, not =, for assignment.
PtT = rep(0,S)
^
R/bd_loglik.R:167:19: style: Commas should always have a space after.
PtT = rep(0,S)
^
R/bd_loglik.R:168:10: style: Use <-, not =, for assignment.
ux = rep(0,S)
^
R/bd_loglik.R:168:18: style: Commas should always have a space after.
ux = rep(0,S)
^
R/bd_loglik.R:169:1: style: Trailing whitespace is superfluous.
^~~~~~
R/bd_loglik.R:170:7: warning: local variable ‘abstol’ assigned but may not be used
abstol = 1e-16
^~~~~~
R/bd_loglik.R:170:14: style: Use <-, not =, for assignment.
abstol = 1e-16
^
R/bd_loglik.R:171:7: warning: local variable ‘reltol’ assigned but may not be used
reltol = 1e-10
^~~~~~
R/bd_loglik.R:171:14: style: Use <-, not =, for assignment.
reltol = 1e-10
^
R/bd_loglik.R:171:21: style: Trailing whitespace is superfluous.
reltol = 1e-10
^
R/bd_loglik.R:172:1: style: Trailing whitespace is superfluous.
^~~~~~
R/bd_loglik.R:173:7: style: Variable or function name should be snake_case.
T0 = TT
^~
R/bd_loglik.R:173:10: style: Use <-, not =, for assignment.
T0 = TT
^
R/bd_loglik.R:174:11: style: Use <-, not =, for assignment.
la0 = pars1[1]
^
R/bd_loglik.R:175:11: style: Use <-, not =, for assignment.
mu0 = pars1[2]
^
R/bd_loglik.R:176:9: style: Place a space before left parenthesis, except in a function call.
if(length(pars1) > 2)
^
R/bd_loglik.R:177:7: style: Opening curly braces should never go on their own line and should always be followed by a new line.
{
^
R/bd_loglik.R:178:13: style: Use <-, not =, for assignment.
la1 = pars1[3]
^
R/bd_loglik.R:179:9: style: Variable or function name should be snake_case.
K = pars1[3]
^
R/bd_loglik.R:179:11: style: Use <-, not =, for assignment.
K = pars1[3]
^
R/bd_loglik.R:180:13: style: Use <-, not =, for assignment.
mu1 = pars1[4]
^
R/bd_loglik.R:181:11: style: Place a space before left parenthesis, except in a function call.
if(length(pars1) == 5)
^
R/bd_loglik.R:182:9: style: Opening curly braces should never go on their own line and should always be followed by a new line.
{
^
R/bd_loglik.R:183:12: style: Variable or function name should be snake_case.
T0 = pars1[5]
^~
R/bd_loglik.R:183:15: style: Use <-, not =, for assignment.
T0 = pars1[5]
^
R/bd_loglik.R:184:10: style: Trailing whitespace is superfluous.
}
^
R/bd_loglik.R:186:13: style: Use <-, not =, for assignment.
la1 = 0
^
R/bd_loglik.R:187:9: style: Variable or function name should be snake_case.
K = Inf
^
R/bd_loglik.R:187:11: style: Use <-, not =, for assignment.
K = Inf
^
R/bd_loglik.R:188:13: style: Use <-, not =, for assignment.
mu1 = 0
^
R/bd_loglik.R:189:15: style: Use <-, not =, for assignment.
pars1 = c(pars1,c(0,0))
^
R/bd_loglik.R:189:25: style: Commas should always have a space after.
pars1 = c(pars1,c(0,0))
^
R/bd_loglik.R:189:29: style: Commas should always have a space after.
pars1 = c(pars1,c(0,0))
^
R/bd_loglik.R:191:1: style: Trailing whitespace is superfluous.
^~~~~~
R/bd_loglik.R:192:9: style: Place a space before left parenthesis, except in a function call.
if(tdmodel == 1)
^
R/bd_loglik.R:193:7: style: Opening curly braces should never go on their own line and should always be followed by a new line.
{
^
R/bd_loglik.R:194:13: style: Use <-, not =, for assignment.
la0 = la0 * exp(-la1 * (T0 - TT))
^
R/bd_loglik.R:195:13: style: Use <-, not =, for assignment.
mu0 = mu0 * exp(-mu1 * (T0 - TT))
^
R/bd_loglik.R:196:8: style: Trailing whitespace is superfluous.
}
^
R/bd_loglik.R:197:1: style: Trailing whitespace is superfluous.
^~~~~~
R/bd_loglik.R:198:14: style: Use <-, not =, for assignment.
loglik = (btorph == 0) * lgamma(S)
^
R/bd_loglik.R:199:1: style: Trailing whitespace is superfluous.
^~~~~~
R/bd_loglik.R:200:9: style: Place a space before left parenthesis, except in a function call.
if(tdmodel == 0 | (tdmodel == 1 & la1 == 0 & mu1 == 0))
^
R/bd_loglik.R:201:7: style: Opening curly braces should never go on their own line and should always be followed by a new line.
{
^
R/bd_loglik.R:202:11: style: Place a space before left parenthesis, except in a function call.
if(abs(la0 - mu0) < 1E-10)
^
R/bd_loglik_choosepar.R:1:1: style: Lines should not be more than 80 characters.
bd_loglik_choosepar = function(trparsopt,trparsfix,idparsopt,idparsfix,pars2,brts,missnumspec,methode)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R/bd_loglik_choosepar.R:1:21: style: Use <-, not =, for assignment.
bd_loglik_choosepar = function(trparsopt,trparsfix,idparsopt,idparsfix,pars2,brts,missnumspec,methode)
^
R/bd_loglik_choosepar.R:1:42: style: Commas should always have a space after.
bd_loglik_choosepar = function(trparsopt,trparsfix,idparsopt,idparsfix,pars2,brts,missnumspec,methode)
^
R/bd_loglik_choosepar.R:1:52: style: Commas should always have a space after.
bd_loglik_choosepar = function(trparsopt,trparsfix,idparsopt,idparsfix,pars2,brts,missnumspec,methode)
^
R/bd_loglik_choosepar.R:1:62: style: Commas should always have a space after.
bd_loglik_choosepar = function(trparsopt,trparsfix,idparsopt,idparsfix,pars2,brts,missnumspec,methode)
^
R/bd_loglik_choosepar.R:1:72: style: Commas should always have a space after.
bd_loglik_choosepar = function(trparsopt,trparsfix,idparsopt,idparsfix,pars2,brts,missnumspec,methode)
^
R/bd_loglik_choosepar.R:1:78: style: Commas should always have a space after.
bd_loglik_choosepar = function(trparsopt,trparsfix,idparsopt,idparsfix,pars2,brts,missnumspec,methode)
^
R/bd_loglik_choosepar.R:1:83: style: Commas should always have a space after.
bd_loglik_choosepar = function(trparsopt,trparsfix,idparsopt,idparsfix,pars2,brts,missnumspec,methode)
^
R/bd_loglik_choosepar.R:1:95: style: Commas should always have a space after.
bd_loglik_choosepar = function(trparsopt,trparsfix,idparsopt,idparsfix,pars2,brts,missnumspec,methode)
^
R/bd_loglik_choosepar.R:2:1: style: Opening curly braces should never go on their own line and should always be followed by a new line.
{
^
R/bd_loglik_choosepar.R:3:12: style: Use <-, not =, for assignment.
trpars1 = rep(0,4)
^
R/bd_loglik_choosepar.R:3:20: style: Commas should always have a space after.
trpars1 = rep(0,4)
^
R/bd_loglik_choosepar.R:4:23: style: Use <-, not =, for assignment.
trpars1[idparsopt] = trparsopt
^
R/bd_loglik_choosepar.R:5:6: style: Place a space before left parenthesis, except in a function call.
if(length(idparsfix) != 0)
^
R/bd_loglik_choosepar.R:6:4: style: Opening curly braces should never go on their own line and should always be followed by a new line.
{
^
R/bd_loglik_choosepar.R:7:26: style: Use <-, not =, for assignment.
trpars1[idparsfix] = trparsfix
^
R/bd_loglik_choosepar.R:9:6: style: Place a space before left parenthesis, except in a function call.
if(max(trpars1) > 1 | min(trpars1) < 0)
^
R/bd_loglik_choosepar.R:10:4: style: Opening curly braces should never go on their own line and should always be followed by a new line.
{
^
R/bd_loglik_choosepar.R:11:14: style: Use <-, not =, for assignment.
loglik = -Inf
^
R/bd_loglik_choosepar.R:13:13: style: Use <-, not =, for assignment.
pars1 = trpars1/(1 - trpars1)
^
R/bd_loglik_choosepar.R:13:22: style: Put spaces around all infix operators.
pars1 = trpars1/(1 - trpars1)
~^~
R/bd_loglik_choosepar.R:13:23: style: Place a space before left parenthesis, except in a function call.
pars1 = trpars1/(1 - trpars1)
^
R/bd_loglik_choosepar.R:14:1: style: Lines should not be more than 80 characters.
loglik = bd_loglik(pars1 = pars1,pars2 = pars2[1:6],brts = brts,missnumspec = missnumspec, methode = methode)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R/bd_loglik_choosepar.R:14:14: style: Use <-, not =, for assignment.
loglik = bd_loglik(pars1 = pars1,pars2 = pars2[1:6],brts = brts,missnumspec = missnumspec, methode = methode)
^
R/bd_loglik_choosepar.R:14:16: warning: no visible global function definition for ‘bd_loglik’
loglik = bd_loglik(pars1 = pars1,pars2 = pars2[1:6],brts = brts,missnumspec = missnumspec, methode = methode)
^~~~~~~~~
R/bd_loglik_choosepar.R:14:40: style: Commas should always have a space after.
loglik = bd_loglik(pars1 = pars1,pars2 = pars2[1:6],brts = brts,missnumspec = missnumspec, methode = methode)
^
R/bd_loglik_choosepar.R:14:59: style: Commas should always have a space after.
loglik = bd_loglik(pars1 = pars1,pars2 = pars2[1:6],brts = brts,missnumspec = missnumspec, methode = methode)
^
R/bd_loglik_choosepar.R:14:71: style: Commas should always have a space after.
loglik = bd_loglik(pars1 = pars1,pars2 = pars2[1:6],brts = brts,missnumspec = missnumspec, methode = methode)
^
R/bd_loglik_choosepar.R:15:9: style: Place a space before left parenthesis, except in a function call.
if(is.nan(loglik) || is.na(loglik))
^
R/bd_loglik_choosepar.R:16:7: style: Opening curly braces should never go on their own line and should always be followed by a new line.
{
^
R/bd_loglik_choosepar.R:17:1: style: Lines should not be more than 80 characters.
cat("There are parameter values used which cause numerical problems.\n")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R/bd_loglik_choosepar.R:18:17: style: Use <-, not =, for assignment.
loglik = -Inf
^
R/bd_loglik.R:2:3: style: Trailing whitespace is superfluous.
#'
^
R/bd_loglik.R:6:3: style: Trailing whitespace is superfluous.
#'
^
R/bd_loglik.R:7:3: style: Trailing whitespace is superfluous.
#'
^
R/bd_loglik.R:41:1: style: Lines should not be more than 80 characters.
#' \cr \cr \code{pars2[4]} sets whether the parameters and likelihood should be shown
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R/bd_loglik.R:58:1: style: Lines should not be more than 80 characters.
#' bd_loglik(pars1 = c(0.5,0.1), pars2 = c(0,1,1,0,2), brts = 1:10, missnumspec = 0)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R/bd_loglik.R:58:85: style: Trailing whitespace is superfluous.
#' bd_loglik(pars1 = c(0.5,0.1), pars2 = c(0,1,1,0,2), brts = 1:10, missnumspec = 0)
^
R/bd_loglik.R:60:11: style: Use <-, not =, for assignment.
bd_loglik = function(pars1,pars2,brts,missnumspec,methode = 'lsoda')
^
R/bd_loglik.R:60:28: style: Commas should always have a space after.
bd_loglik = function(pars1,pars2,brts,missnumspec,methode = 'lsoda')
^
R/bd_loglik.R:60:34: style: Commas should always have a space after.
bd_loglik = function(pars1,pars2,brts,missnumspec,methode = 'lsoda')
^
R/bd_loglik.R:60:39: style: Commas should always have a space after.
bd_loglik = function(pars1,pars2,brts,missnumspec,methode = 'lsoda')
^
R/bd_loglik.R:60:51: style: Commas should always have a space after.
bd_loglik = function(pars1,pars2,brts,missnumspec,methode = 'lsoda')
^
R/bd_loglik.R:60:61: style: Only use double-quotes.
bd_loglik = function(pars1,pars2,brts,missnumspec,methode = 'lsoda')
^~~~~~~
R/bd_loglik.R:64:1: style: Lines should not be more than 80 characters.
# - pars1[3] = la1 = parameter in exponential decay of speciation rate, OR K in diversity-dependence-like models (default 0)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R/bd_loglik.R:65:1: style: Lines should not be more than 80 characters.
# - pars1[4] = mu1 = parameter in exponential decay of extinction rate (default 0)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R/bd_loglik.R:66:1: style: Lines should not be more than 80 characters.
# - pars1[5] = T0 = age at which lambda is lambda0 (default T0 = age of phylogeny)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R/bd_loglik.R:71:1: style: Lines should not be more than 80 characters.
# . tdmodel == 2: stepwise decline following diversity-dependence when extinction = 0
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R/bd_loglik.R:72:1: style: Lines should not be more than 80 characters.
# . tdmodel == 3: decline in speciation rate following deterministic logistic equation for ddmodel = 1
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R/bd_loglik.R:73:1: style: Lines should not be more than 80 characters.
# . tdmodel == 4...8: change in speciation/extinction rate following ddmodel = 1...5, with n = expected number of species
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R/bd_loglik.R:74:1: style: Lines should not be more than 80 characters.
# - pars2[2] = cond = conditioning on age (0), non-extinction of the clade and age (1), number of taxa and age (2), number of taxa (3)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R/bd_loglik.R:77:1: style: Lines should not be more than 80 characters.
# - pars2[5] = likelihood is for a tree with crown age (2) or stem age (1) - stem age not yet implemented for tdmodel == 2
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R/bd_loglik.R:80:1: style: Opening curly braces should never go on their own line and should always be followed by a new line.
{
^
R/bd_loglik.R:81:11: style: Use <-, not =, for assignment.
rhotaut = function(tau,t1,pars)
^
R/bd_loglik.R:81:26: style: Commas should always have a space after.
rhotaut = function(tau,t1,pars)
^
R/bd_loglik.R:81:29: style: Commas should always have a space after.
rhotaut = function(tau,t1,pars)
^
R/bd_loglik.R:82:3: style: Opening curly braces should never go on their own line and should always be followed by a new line.
{
^
R/bd_loglik.R:83:9: style: Use <-, not =, for assignment.
la0 = pars[1]
^
R/bd_loglik.R:84:9: style: Use <-, not =, for assignment.
mu0 = pars[2]
^
R/bd_loglik.R:85:9: style: Use <-, not =, for assignment.
la1 = pars[3]
^
R/bd_loglik.R:86:9: style: Use <-, not =, for assignment.
mu1 = pars[4]
^
R/bd_loglik.R:86:18: style: Trailing whitespace is superfluous.
mu1 = pars[4]
^~
R/bd_loglik.R:87:7: style: Place a space before left parenthesis, except in a function call.
if(la1 == 0 & mu1 == 0) {rtt = mu0 * (tau - t1) - la0 * (tau - t1)}
^
R/bd_loglik.R:87:29: style: Opening curly braces should never go on their own line and should always be followed by a new line.
if(la1 == 0 & mu1 == 0) {rtt = mu0 * (tau - t1) - la0 * (tau - t1)}
^
R/bd_loglik.R:87:34: style: Use <-, not =, for assignment.
if(la1 == 0 & mu1 == 0) {rtt = mu0 * (tau - t1) - la0 * (tau - t1)}
^
R/bd_loglik.R:87:71: style: Closing curly-braces should always be on their own line, unless it's followed by an else.
if(la1 == 0 & mu1 == 0) {rtt = mu0 * (tau - t1) - la0 * (tau - t1)}
^
R/bd_loglik.R:88:1: style: Lines should not be more than 80 characters.
if(la1 > 0 & mu1 == 0) {rtt = mu0 * (tau - t1) - la0/la1 * (exp(-la1*t1) - exp(-la1*tau))}
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R/bd_loglik.R:88:7: style: Place a space before left parenthesis, except in a function call.
if(la1 > 0 & mu1 == 0) {rtt = mu0 * (tau - t1) - la0/la1 * (exp(-la1*t1) - exp(-la1*tau))}
^
R/bd_loglik.R:88:28: style: Opening curly braces should never go on their own line and should always be followed by a new line.
if(la1 > 0 & mu1 == 0) {rtt = mu0 * (tau - t1) - la0/la1 * (exp(-la1*t1) - exp(-la1*tau))}
^
R/bd_loglik.R:88:33: style: Use <-, not =, for assignment.
if(la1 > 0 & mu1 == 0) {rtt = mu0 * (tau - t1) - la0/la1 * (exp(-la1*t1) - exp(-la1*tau))}
^
R/bd_loglik.R:88:57: style: Put spaces around all infix operators.
if(la1 > 0 & mu1 == 0) {rtt = mu0 * (tau - t1) - la0/la1 * (exp(-la1*t1) - exp(-la1*tau))}
~^~
R/bd_loglik.R:88:73: style: Put spaces around all infix operators.
if(la1 > 0 & mu1 == 0) {rtt = mu0 * (tau - t1) - la0/la1 * (exp(-la1*t1) - exp(-la1*tau))}
~^~
R/bd_loglik.R:88:88: style: Put spaces around all infix operators.
if(la1 > 0 & mu1 == 0) {rtt = mu0 * (tau - t1) - la0/la1 * (exp(-la1*t1) - exp(-la1*tau))}
~^~
R/bd_loglik.R:88:94: style: Closing curly-braces should always be on their own line, unless it's followed by an else.
if(la1 > 0 & mu1 == 0) {rtt = mu0 * (tau - t1) - la0/la1 * (exp(-la1*t1) - exp(-la1*tau))}
^
R/bd_loglik.R:89:1: style: Lines should not be more than 80 characters.
if(la1 == 0 & mu1 > 0) {rtt = mu0/mu1 * (exp(-mu1*t1) - exp(-mu1*tau)) - la0 * (tau - t1)}
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R/bd_loglik.R:89:7: style: Place a space before left parenthesis, except in a function call.
if(la1 == 0 & mu1 > 0) {rtt = mu0/mu1 * (exp(-mu1*t1) - exp(-mu1*tau)) - la0 * (tau - t1)}
^
R/bd_loglik.R:89:28: style: Opening curly braces should never go on their own line and should always be followed by a new line.
if(la1 == 0 & mu1 > 0) {rtt = mu0/mu1 * (exp(-mu1*t1) - exp(-mu1*tau)) - la0 * (tau - t1)}
^
R/bd_loglik.R:89:33: style: Use <-, not =, for assignment.
if(la1 == 0 & mu1 > 0) {rtt = mu0/mu1 * (exp(-mu1*t1) - exp(-mu1*tau)) - la0 * (tau - t1)}
^
R/bd_loglik.R:89:38: style: Put spaces around all infix operators.
if(la1 == 0 & mu1 > 0) {rtt = mu0/mu1 * (exp(-mu1*t1) - exp(-mu1*tau)) - la0 * (tau - t1)}
~^~
R/bd_loglik.R:89:54: style: Put spaces around all infix operators.
if(la1 == 0 & mu1 > 0) {rtt = mu0/mu1 * (exp(-mu1*t1) - exp(-mu1*tau)) - la0 * (tau - t1)}
~^~
R/bd_loglik.R:89:69: style: Put spaces around all infix operators.
if(la1 == 0 & mu1 > 0) {rtt = mu0/mu1 * (exp(-mu1*t1) - exp(-mu1*tau)) - la0 * (tau - t1)}
~^~
R/bd_loglik.R:89:94: style: Closing curly-braces should always be on their own line, unless it's followed by an else.
if(la1 == 0 & mu1 > 0) {rtt = mu0/mu1 * (exp(-mu1*t1) - exp(-mu1*tau)) - la0 * (tau - t1)}
^
R/bd_loglik.R:90:1: style: Lines should not be more than 80 characters.
if(la1 > 0 & mu1 > 0) {rtt = mu0/mu1 * (exp(-mu1*t1) - exp(-mu1*tau)) - la0/la1 * (exp(-la1*t1) - exp(-la1*tau))}
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R/bd_loglik.R:90:7: style: Place a space before left parenthesis, except in a function call.
if(la1 > 0 & mu1 > 0) {rtt = mu0/mu1 * (exp(-mu1*t1) - exp(-mu1*tau)) - la0/la1 * (exp(-la1*t1) - exp(-la1*tau))}
^
R/bd_loglik.R:90:27: style: Opening curly braces should never go on their own line and should always be followed by a new line.
if(la1 > 0 & mu1 > 0) {rtt = mu0/mu1 * (exp(-mu1*t1) - exp(-mu1*tau)) - la0/la1 * (exp(-la1*t1) - exp(-la1*tau))}
^
R/bd_loglik.R:90:32: style: Use <-, not =, for assignment.
if(la1 > 0 & mu1 > 0) {rtt = mu0/mu1 * (exp(-mu1*t1) - exp(-mu1*tau)) - la0/la1 * (exp(-la1*t1) - exp(-la1*tau))}
^
R/bd_loglik.R:90:37: style: Put spaces around all infix operators.
if(la1 > 0 & mu1 > 0) {rtt = mu0/mu1 * (exp(-mu1*t1) - exp(-mu1*tau)) - la0/la1 * (exp(-la1*t1) - exp(-la1*tau))}
~^~
R/bd_loglik.R:90:53: style: Put spaces around all infix operators.
if(la1 > 0 & mu1 > 0) {rtt = mu0/mu1 * (exp(-mu1*t1) - exp(-mu1*tau)) - la0/la1 * (exp(-la1*t1) - exp(-la1*tau))}
~^~
R/bd_loglik.R:90:68: style: Put spaces around all infix operators.
if(la1 > 0 & mu1 > 0) {rtt = mu0/mu1 * (exp(-mu1*t1) - exp(-mu1*tau)) - la0/la1 * (exp(-la1*t1) - exp(-la1*tau))}
~^~
R/bd_loglik.R:90:80: style: Put spaces around all infix operators.
if(la1 > 0 & mu1 > 0) {rtt = mu0/mu1 * (exp(-mu1*t1) - exp(-mu1*tau)) - la0/la1 * (exp(-la1*t1) - exp(-la1*tau))}
~^~
R/bd_loglik.R:90:96: style: Put spaces around all infix operators.
if(la1 > 0 & mu1 > 0) {rtt = mu0/mu1 * (exp(-mu1*t1) - exp(-mu1*tau)) - la0/la1 * (exp(-la1*t1) - exp(-la1*tau))}
~^~
R/bd_loglik.R:90:111: style: Put spaces around all infix operators.
if(la1 > 0 & mu1 > 0) {rtt = mu0/mu1 * (exp(-mu1*t1) - exp(-mu1*tau)) - la0/la1 * (exp(-la1*t1) - exp(-la1*tau))}
~^~
R/bd_loglik.R:90:117: style: Closing curly-braces should always be on their own line, unless it's followed by an else.
if(la1 > 0 & mu1 > 0) {rtt = mu0/mu1 * (exp(-mu1*t1) - exp(-mu1*tau)) - la0/la1 * (exp(-la1*t1) - exp(-la1*tau))}
^
R/bd_loglik.R:93:1: style: Trailing whitespace is superfluous.
^~
R/bd_loglik.R:94:3: style: Variable or function name should be snake_case.
PtTint = function(x,t1,pars)
^~~~~~
R/bd_loglik.R:94:10: style: Use <-, not =, for assignment.
PtTint = function(x,t1,pars)
^
R/bd_loglik.R:94:23: style: Commas should always have a space after.
PtTint = function(x,t1,pars)
^
R/bd_loglik.R:94:26: style: Commas should always have a space after.
PtTint = function(x,t1,pars)
^
R/bd_loglik.R:95:3: style: Opening curly braces should never go on their own line and should always be followed by a new line.
{
^
R/bd_loglik.R:95:4: style: Trailing whitespace is superfluous.
{
^
R/bd_loglik.R:96:5: style: Variable or function name should be snake_case.
PtTint = pars[2] * exp(-pars[4] * x) * exp(rhotaut(x,t1,pars))
^~~~~~
R/bd_loglik.R:96:12: style: Use <-, not =, for assignment.
PtTint = pars[2] * exp(-pars[4] * x) * exp(rhotaut(x,t1,pars))
^
R/bd_loglik.R:96:58: style: Commas should always have a space after.
PtTint = pars[2] * exp(-pars[4] * x) * exp(rhotaut(x,t1,pars))
^
R/bd_loglik.R:96:61: style: Commas should always have a space after.
PtTint = pars[2] * exp(-pars[4] * x) * exp(rhotaut(x,t1,pars))
^
R/bd_loglik.R:99:1: style: Trailing whitespace is superfluous.
^~
R/bd_loglik.R:100:6: style: Use <-, not =, for assignment.
ff = function(t1,pars)
^
R/bd_loglik.R:100:20: style: Commas should always have a space after.
ff = function(t1,pars)
^
R/bd_loglik.R:101:3: style: Opening curly braces should never go on their own line and should always be followed by a new line.
{
^
R/bd_loglik.R:102:8: style: Use <-, not =, for assignment.
ff = 1/pars[3] + (1/2 - 1/pars[3]) * exp(-(pars[1] - pars[2]) * t1)
^
R/bd_loglik.R:102:11: style: Put spaces around all infix operators.
ff = 1/pars[3] + (1/2 - 1/pars[3]) * exp(-(pars[1] - pars[2]) * t1)
~^~
R/bd_loglik.R:102:24: style: Put spaces around all infix operators.
ff = 1/pars[3] + (1/2 - 1/pars[3]) * exp(-(pars[1] - pars[2]) * t1)
~^~
R/bd_loglik.R:102:30: style: Put spaces around all infix operators.
ff = 1/pars[3] + (1/2 - 1/pars[3]) * exp(-(pars[1] - pars[2]) * t1)
~^~
R/bd_loglik.R:102:47: style: Place a space before left parenthesis, except in a function call.
ff = 1/pars[3] + (1/2 - 1/pars[3]) * exp(-(pars[1] - pars[2]) * t1)
^
R/bd_loglik.R:105:1: style: Trailing whitespace is superfluous.
^~
R/bd_loglik.R:106:15: style: Use <-, not =, for assignment.
exprhotaut2 = function(tau,t1,pars)
^
R/bd_loglik.R:106:30: style: Commas should always have a space after.
exprhotaut2 = function(tau,t1,pars)
^
R/bd_loglik.R:106:33: style: Commas should always have a space after.
exprhotaut2 = function(tau,t1,pars)
^
R/bd_loglik.R:107:3: style: Opening curly braces should never go on their own line and should always be followed by a new line.
{
^
R/bd_loglik.R:107:4: style: Trailing whitespace is superfluous.
{
^~~
R/bd_loglik.R:108:9: style: Use <-, not =, for assignment.
rtt = ff(tau,pars)/ff(t1,pars)
^
R/bd_loglik.R:108:18: style: Commas should always have a space after.
rtt = ff(tau,pars)/ff(t1,pars)
^
R/bd_loglik.R:108:23: style: Put spaces around all infix operators.
rtt = ff(tau,pars)/ff(t1,pars)
~^~
R/bd_loglik.R:108:30: style: Commas should always have a space after.
rtt = ff(tau,pars)/ff(t1,pars)
^
R/bd_loglik.R:111:1: style: Trailing whitespace is superfluous.
^~
R/bd_loglik.R:112:3: style: Variable or function name should be snake_case.
intPtTint2 = function(t1,T,pars)
^~~~~~~~~~
R/bd_loglik.R:112:14: style: Use <-, not =, for assignment.
intPtTint2 = function(t1,T,pars)
^
R/bd_loglik.R:112:28: style: Commas should always have a space after.
intPtTint2 = function(t1,T,pars)
^
R/bd_loglik.R:112:30: style: Commas should always have a space after.
intPtTint2 = function(t1,T,pars)
^
R/bd_loglik.R:113:3: style: Opening curly braces should never go on their own line and should always be followed by a new line.
{
^
R/bd_loglik.R:114:1: style: Lines should not be more than 80 characters.
intPtTint2 = pars[2]/ff(t1,pars) * ( (T - t1)/pars[3] + (ff(t1,pars) - ff(T,pars))/(pars[1] - pars[2]) )
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R/bd_loglik.R:114:5: style: Variable or function name should be snake_case.
intPtTint2 = pars[2]/ff(t1,pars) * ( (T - t1)/pars[3] + (ff(t1,pars) - ff(T,pars))/(pars[1] - pars[2]) )
^~~~~~~~~~
R/bd_loglik.R:114:16: style: Use <-, not =, for assignment.
intPtTint2 = pars[2]/ff(t1,pars) * ( (T - t1)/pars[3] + (ff(t1,pars) - ff(T,pars))/(pars[1] - pars[2]) )
^
R/bd_loglik.R:114:25: style: Put spaces around all infix operators.
intPtTint2 = pars[2]/ff(t1,pars) * ( (T - t1)/pars[3] + (ff(t1,pars) - ff(T,pars))/(pars[1] - pars[2]) )
~^~
R/bd_loglik.R:114:32: style: Commas should always have a space after.
intPtTint2 = pars[2]/ff(t1,pars) * ( (T - t1)/pars[3] + (ff(t1,pars) - ff(T,pars))/(pars[1] - pars[2]) )
^
R/bd_loglik.R:114:41: style: Do not place spaces around code in parentheses or square brackets.
intPtTint2 = pars[2]/ff(t1,pars) * ( (T - t1)/pars[3] + (ff(t1,pars) - ff(T,pars))/(pars[1] - pars[2]) )
^
R/bd_loglik.R:114:50: style: Put spaces around all infix operators.
intPtTint2 = pars[2]/ff(t1,pars) * ( (T - t1)/pars[3] + (ff(t1,pars) - ff(T,pars))/(pars[1] - pars[2]) )
~^~
R/bd_loglik.R:114:68: style: Commas should always have a space after.
intPtTint2 = pars[2]/ff(t1,pars) * ( (T - t1)/pars[3] + (ff(t1,pars) - ff(T,pars))/(pars[1] - pars[2]) )
^
R/bd_loglik.R:114:81: style: Commas should always have a space after.
intPtTint2 = pars[2]/ff(t1,pars) * ( (T - t1)/pars[3] + (ff(t1,pars) - ff(T,pars))/(pars[1] - pars[2]) )
^
R/bd_loglik.R:114:87: style: Put spaces around all infix operators.
intPtTint2 = pars[2]/ff(t1,pars) * ( (T - t1)/pars[3] + (ff(t1,pars) - ff(T,pars))/(pars[1] - pars[2]) )
~^~
R/bd_loglik.R:114:88: style: Place a space before left parenthesis, except in a function call.
intPtTint2 = pars[2]/ff(t1,pars) * ( (T - t1)/pars[3] + (ff(t1,pars) - ff(T,pars))/(pars[1] - pars[2]) )
^
R/bd_loglik.R:114:107: style: Do not place spaces around code in parentheses or square brackets.
intPtTint2 = pars[2]/ff(t1,pars) * ( (T - t1)/pars[3] + (ff(t1,pars) - ff(T,pars))/(pars[1] - pars[2]) )
^
R/bd_loglik.R:117:1: style: Trailing whitespace is superfluous.
^~
R/bd_loglik.R:118:11: style: Use <-, not =, for assignment.
tdmodel = pars2[1]
^
R/bd_loglik.R:119:5: style: Place a space before left parenthesis, except in a function call.
if(min(pars1) < 0 | (tdmodel == 4 & pars1[1] <= pars1[2]))
^
R/bd_loglik.R:120:3: style: Opening curly braces should never go on their own line and should always be followed by a new line.
{
^
R/bd_loglik.R:122:13: style: Use <-, not =, for assignment.
loglik = -Inf
^
R/bd_loglik.R:125:10: style: Use <-, not =, for assignment.
cond = pars2[2]
^
R/bd_loglik.R:126:9: style: Use <-, not =, for assignment.
soc = pars2[5]
^
R/bd_loglik.R:127:7: style: Place a space before left parenthesis, except in a function call.
if(cond == 3)
^
R/bd_loglik.R:128:5: style: Opening curly braces should never go on their own line and should always be followed by a new line.
{
^
R/bd_loglik.R:129:12: style: Use <-, not =, for assignment.
soc = 2
^
R/bd_loglik.R:131:12: style: Use <-, not =, for assignment.
btorph = pars2[3]
^
R/bd_loglik.R:132:7: style: Use <-, not =, for assignment.
m = missnumspec
^
R/bd_loglik.R:133:7: style: Place a space before left parenthesis, except in a function call.
if(is.na(pars2[6]))
^
R/bd_loglik.R:134:5: style: Opening curly braces should never go on their own line and should always be followed by a new line.
{
^
R/bd_loglik.R:135:17: style: Use <-, not =, for assignment.
pars2[6] = Inf
^
R/bd_loglik.R:136:6: style: Trailing whitespace is superfluous.
}
^~
R/bd_loglik.R:137:1: style: Trailing whitespace is superfluous.
^~~~
R/bd_loglik.R:138:7: style: Place a space before left parenthesis, except in a function call.
if(soc == 1 & tdmodel == 2)
^
R/bd_loglik.R:139:5: style: Opening curly braces should never go on their own line and should always be followed by a new line.
{
^
R/bd_loglik.R:140:1: style: Lines should not be more than 80 characters.
cat("Stem age and conditioning on extant taxa only have not yet been implemented for this model. Use dd_loglik instead\n")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R/bd_loglik.R:141:14: style: Use <-, not =, for assignment.
loglik = -Inf
^
R/bd_loglik.R:143:12: style: Opening curly braces should never go on their own line and should always be followed by a new line.
} else {
^
R/bd_loglik.R:143:13: style: Trailing whitespace is superfluous.
} else {
^~~~~~~~
R/bd_loglik.R:144:12: style: Use <-, not =, for assignment.
brts = sort(abs(as.numeric(brts)),decreasing = TRUE)
^
R/bd_loglik.R:144:41: style: Commas should always have a space after.
brts = sort(abs(as.numeric(brts)),decreasing = TRUE)
^
R/bd_loglik.R:145:9: style: Place a space before left parenthesis, except in a function call.
if(brts[length(brts)] == 0)
^
R/bd_loglik.R:146:7: style: Opening curly braces should never go on their own line and should always be followed by a new line.
{
^
R/bd_loglik.R:147:15: style: Use <-, not =, for assignment.
brts = brts[-length(brts)]
^
R/bd_loglik.R:149:13: style: Use <-, not =, for assignment.
brts2 = c(-sort(abs(as.numeric(brts)),decreasing = TRUE),0)
^
R/bd_loglik.R:149:45: style: Commas should always have a space after.
brts2 = c(-sort(abs(as.numeric(brts)),decreasing = TRUE),0)
^
R/bd_loglik.R:149:64: style: Commas should always have a space after.
brts2 = c(-sort(abs(as.numeric(brts)),decreasing = TRUE),0)
^
R/bd_loglik.R:150:10: style: Place a space before left parenthesis, except in a function call.
for(i in 2:length(brts2))
^
R/bd_loglik.R:151:7: style: Opening curly braces should never go on their own line and should always be followed by a new line.
{
^
R/bd_loglik.R:152:12: style: Place a space before left parenthesis, except in a function call.
if(brts2[i] == brts2[i - 1])
^
R/bd_loglik.R:153:10: style: Opening curly braces should never go on their own line and should always be followed by a new line.
{
^
R/bd_loglik.R:154:22: style: Use <-, not =, for assignment.
brts2[i] = brts2[i] + 1E-10
^
R/bd_loglik.R:157:9: style: Place a space before left parenthesis, except in a function call.
if(soc == 2)
^
R/bd_loglik.R:158:7: style: Opening curly braces should never go on their own line and should always be followed by a new line.
{
^
R/bd_loglik.R:159:14: style: Use <-, not =, for assignment.
brts = c(brts[1],brts)
^
R/bd_loglik.R:159:26: style: Commas should always have a space after.
brts = c(brts[1],brts)
^
R/bd_loglik.R:161:7: style: Variable or function name should be snake_case.
TT = brts[1]
^~
R/bd_loglik.R:161:10: style: Use <-, not =, for assignment.
TT = brts[1]
^
R/bd_loglik.R:162:9: style: Use <-, not =, for assignment.
t = TT - brts
^
R/bd_loglik.R:163:1: style: Trailing whitespace is superfluous.
^~~~~~
R/bd_loglik.R:164:7: style: Variable or function name should be snake_case.
S = length(brts)
^
R/bd_loglik.R:164:9: style: Use <-, not =, for assignment.
S = length(brts)
^
R/bd_loglik.R:165:7: style: Variable or function name should be snake_case.
N = S + m
^
R/bd_loglik.R:165:9: style: Use <-, not =, for assignment.
N = S + m
^
R/bd_loglik.R:166:10: style: Use <-, not =, for assignment.
np = length(brts2)
^
R/bd_loglik.R:167:7: style: Variable or function name should be snake_case.
PtT = rep(0,S)
^~~
R/bd_loglik.R:167:11: style: Use <-, not =, for assignment.
PtT = rep(0,S)
^
R/bd_loglik.R:167:19: style: Commas should always have a space after.
PtT = rep(0,S)
^
R/bd_loglik.R:168:10: style: Use <-, not =, for assignment.
ux = rep(0,S)
^
R/bd_loglik.R:168:18: style: Commas should always have a space after.
ux = rep(0,S)
^
R/bd_loglik.R:169:1: style: Trailing whitespace is superfluous.
^~~~~~
R/bd_loglik.R:170:7: warning: local variable ‘abstol’ assigned but may not be used
abstol = 1e-16
^~~~~~
R/bd_loglik.R:170:14: style: Use <-, not =, for assignment.
abstol = 1e-16
^
R/bd_loglik.R:171:7: warning: local variable ‘reltol’ assigned but may not be used
reltol = 1e-10
^~~~~~
R/bd_loglik.R:171:14: style: Use <-, not =, for assignment.
reltol = 1e-10
^
R/bd_loglik.R:171:21: style: Trailing whitespace is superfluous.
reltol = 1e-10
^
R/bd_loglik.R:172:1: style: Trailing whitespace is superfluous.
^~~~~~
R/bd_loglik.R:173:7: style: Variable or function name should be snake_case.
T0 = TT
^~
R/bd_loglik.R:173:10: style: Use <-, not =, for assignment.
T0 = TT
^
R/bd_loglik.R:174:11: style: Use <-, not =, for assignment.
la0 = pars1[1]
^
R/bd_loglik.R:175:11: style: Use <-, not =, for assignment.
mu0 = pars1[2]
^
R/bd_loglik.R:176:9: style: Place a space before left parenthesis, except in a function call.
if(length(pars1) > 2)
^
R/bd_loglik.R:177:7: style: Opening curly braces should never go on their own line and should always be followed by a new line.
{
^
R/bd_loglik.R:178:13: style: Use <-, not =, for assignment.
la1 = pars1[3]
^
R/bd_loglik.R:179:9: style: Variable or function name should be snake_case.
K = pars1[3]
^
R/bd_loglik.R:179:11: style: Use <-, not =, for assignment.
K = pars1[3]
^
R/bd_loglik.R:180:13: style: Use <-, not =, for assignment.
mu1 = pars1[4]
^
R/bd_loglik.R:181:11: style: Place a space before left parenthesis, except in a function call.
if(length(pars1) == 5)
^
R/bd_loglik.R:182:9: style: Opening curly braces should never go on their own line and should always be followed by a new line.
{
^
R/bd_loglik.R:183:12: style: Variable or function name should be snake_case.
T0 = pars1[5]
^~
R/bd_loglik.R:183:15: style: Use <-, not =, for assignment.
T0 = pars1[5]
^
R/bd_loglik.R:184:10: style: Trailing whitespace is superfluous.
}
^
R/bd_loglik.R:186:13: style: Use <-, not =, for assignment.
la1 = 0
^
R/bd_loglik.R:187:9: style: Variable or function name should be snake_case.
K = Inf
^
R/bd_loglik.R:187:11: style: Use <-, not =, for assignment.
K = Inf
^
R/bd_loglik.R:188:13: style: Use <-, not =, for assignment.
mu1 = 0
^
R/bd_loglik.R:189:15: style: Use <-, not =, for assignment.
pars1 = c(pars1,c(0,0))
^
R/bd_loglik.R:189:25: style: Commas should always have a space after.
pars1 = c(pars1,c(0,0))
^
R/bd_loglik.R:189:29: style: Commas should always have a space after.
pars1 = c(pars1,c(0,0))
^
R/bd_loglik.R:191:1: style: Trailing whitespace is superfluous.
^~~~~~
R/bd_loglik.R:192:9: style: Place a space before left parenthesis, except in a function call.
if(tdmodel == 1)
^
R/bd_loglik.R:193:7: style: Opening curly braces should never go on their own line and should always be followed by a new line.
{
^
R/bd_loglik.R:194:13: style: Use <-, not =, for assignment.
la0 = la0 * exp(-la1 * (T0 - TT))
^
R/bd_loglik.R:195:13: style: Use <-, not =, for assignment.
mu0 = mu0 * exp(-mu1 * (T0 - TT))
^
R/bd_loglik.R:196:8: style: Trailing whitespace is superfluous.
}
^
R/bd_loglik.R:197:1: style: Trailing whitespace is superfluous.
^~~~~~
R/bd_loglik.R:198:14: style: Use <-, not =, for assignment.
loglik = (btorph == 0) * lgamma(S)
^
R/bd_loglik.R:199:1: style: Trailing whitespace is superfluous.
^~~~~~
R/bd_loglik.R:200:9: style: Place a space before left parenthesis, except in a function call.
if(tdmodel == 0 | (tdmodel == 1 & la1 == 0 & mu1 == 0))
^
R/bd_loglik.R:201:7: style: Opening curly braces should never go on their own line and should always be followed by a new line.
{
^
R/bd_loglik.R:202:11: style: Place a space before left parenthesis, except in a function call.
if(abs(la0 - mu0) < 1E-10)
^
Cool, you've set this up that merging to master needs to be approved by one reviewer! I'd love to try that out!