Skip to content

Commit

Permalink
nicer formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
KlausVigo committed Oct 5, 2019
1 parent 8767fc9 commit 04692c2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
24 changes: 12 additions & 12 deletions R/discrete.gamma.R
Original file line number Diff line number Diff line change
Expand Up @@ -288,31 +288,31 @@ Laguerre <- function(x, shape, degree) {
nChooseK <- function(n, k, log=FALSE) {
nChooseK0 <- function(n, k) {
if((n == k) || (k==0))
return(1);
m <- min(k, n-k);
prod(seq(from=n, to=(n-m+1), by=-1)/(seq(from=m, to=1, by=-1)));
return(1)
m <- min(k, n-k)
prod(seq(from=n, to=(n-m+1), by=-1)/(seq(from=m, to=1, by=-1)))
}
# Process the arguments
if (is.logical(log)) {
if (log == TRUE)
log <- exp(1)
else
log <- NULL;
log <- NULL
}
# Repeat n or k to make the of equal length.
nn <- length(n);
nk <- length(k);
nn <- length(n)
nk <- length(k)
if (nn > nk) {
k <- rep(k, length.out=nn);
nk <- nn;
k <- rep(k, length.out=nn)
nk <- nn
} else if (nn < nk) {
n <- rep(n, length.out=nk);
nn <- nk;
n <- rep(n, length.out=nk)
nn <- nk
}
if (is.null(log)) {
gamma(n+1) / (gamma(n-k+1) * gamma(k+1));
gamma(n+1) / (gamma(n-k+1) * gamma(k+1))
} else {
(lgamma(n+1) - (lgamma(n-k+1) + lgamma(k+1))) / log(log);
(lgamma(n+1) - (lgamma(n-k+1) + lgamma(k+1))) / log(log)
}
}

Expand Down
2 changes: 1 addition & 1 deletion R/phylo.R
Original file line number Diff line number Diff line change
Expand Up @@ -2364,7 +2364,7 @@ optim.pml <- function(object, optNni = FALSE, optBf = FALSE, optQ = FALSE,
message("only one rate class, ignored optGamma")
}
if(Mkv==TRUE & optInv==TRUE){
optInv = FALSE
optInv <- FALSE
message('cannot estimate invariant sites and Mkv model, ignored optInv')
}
shape <- object$shape
Expand Down

0 comments on commit 04692c2

Please sign in to comment.