Skip to content

Commit

Permalink
fix redundant ifelse (flint)
Browse files Browse the repository at this point in the history
  • Loading branch information
KlausVigo committed Nov 28, 2024
1 parent ea57076 commit d10b44a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion R/distSeq.R
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ read.nexus.dist <- function(file){
semico <- grep(";", X)
X <- gsub("\\[(.*?)\\]", "", X) # get rid of comments
i1 <- grep("TAXLABELS", X, ignore.case = TRUE)
taxlab <- ifelse(length(i1) > 0, TRUE, FALSE)
taxlab <- length(i1) > 0
if (taxlab) {
end <- semico[semico >= i1][1]
x <- X[(i1):end] # assumes not a 'new line' after "TRANSLATE"
Expand Down
4 changes: 2 additions & 2 deletions R/plotBS.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
support <- function(tree, trees, method="FBP", tol=2e-8, scale=TRUE){
trees <- keep.tip(trees, tree$tip.label)
method <- match.arg(method, c("FBP", "TBE", "MCC"), several.ok=TRUE)
multi <- ifelse(length(method)>1, TRUE, FALSE)
tip2root <- ifelse(method=="MCC", TRUE, FALSE)
multi <- length(method)>1
tip2root <- method=="MCC"
if(all(sapply(trees, \(x)!is.null(x$edge.length)))){
trees <- di2multi(trees, tol=tol) # , tip2root=tip2root)
}
Expand Down
2 changes: 1 addition & 1 deletion R/read.nexus.splits.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ read.nexus.splits <- function(file) {
sp <- grep("SPLITS;", X, ignore.case = TRUE)
i1 <- i1[i1 < sp]
if(length(i1)>1)i1 <- i1[length(i1)]
taxlab <- ifelse(length(i1) > 0, TRUE, FALSE)
taxlab <- length(i1) > 0
if (taxlab) {
end <- semico[semico >= i1][1]
x <- X[(i1):end] # assumes not a 'new line' after "TRANSLATE"
Expand Down

0 comments on commit d10b44a

Please sign in to comment.