Skip to content

Commit 65391e5

Browse files
committed
Removed imports and fixed if(class) tests
Just trying to comply with CRAN suggestions
1 parent af737f2 commit 65391e5

File tree

9 files changed

+19
-29
lines changed

9 files changed

+19
-29
lines changed

DESCRIPTION

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: rwty
22
Type: Package
33
Title: R We There Yet? Visualizing MCMC Convergence in Phylogenetics
4-
Version: 1.0.2
4+
Version: 1.0.3
55
Authors@R: c(person(given = "Dan", family = "Warren", role = c("aut", "cre"), email = "dan.l.warren@gmail.com"),
66
person(given = "Anthony", family = "Geneva", role = "aut", email = "anthony.geneva@gmail.com"),
77
person(given = "Rob", family = "Lanfear", role = "aut", email = "rob.lanfear@gmail.com"),
@@ -32,18 +32,7 @@ Imports:
3232
ggdendro,
3333
GGally,
3434
parallel,
35-
usedist,
36-
plotly,
37-
png,
38-
gifski,
39-
gganimate,
40-
transformr,
41-
sf,
42-
units,
43-
beepr,
44-
DT,
45-
TreeDist,
46-
magick,
35+
TreeDist
4736
Suggests:
4837
knitr,
4938
testthat,

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ importFrom(TreeDist,InfoRobinsonFoulds)
3636
importFrom(TreeDist,JaccardRobinsonFoulds)
3737
importFrom(TreeDist,MASTInfo)
3838
importFrom(TreeDist,MASTSize)
39+
importFrom(TreeDist,MatchingSplitDistance)
3940
importFrom(TreeDist,MatchingSplitInfoDistance)
4041
importFrom(TreeDist,NNIDist)
4142
importFrom(TreeDist,NyeSimilarity)

R/check.chains.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
check.chains <- function(chains){
2020

2121
# if passed a single trees object, turn it into a list
22-
if(class(chains) == "rwty.chain"){
22+
if(inherits(chains, "rwty.chain")){
2323
chains <- list(chains)
2424
}
2525

2626
# check chains is a list
27-
if(class(chains)!='list'){
27+
if(!inherits(chains, 'list')){
2828
stop("'chains' must be a list of rwty.chain objects")
2929
}
3030

R/clade.freq.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@
2323
# Modified from prop.part in APE, returning data in a more useful format
2424
clade.freq <- function (x, start, end, rooted=FALSE, ...) {
2525

26-
if(class(x) == "rwty.chain"){
26+
if(inherits(x, "rwty.chain")){
2727
x <- x$trees
2828
}
2929

30-
if (length(x) == 1 && class(x[[1]]) == "multiPhylo"){
30+
if (length(x) == 1 && inherits(x[[1]], "multiPhylo")){
3131
x <- x[[1]]
3232
}
3333

R/load.trees.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#'
55
#' @param file A path to a tree file containing an MCMC chain of trees
66
#' @param type An argument that designates the type of tree file. If "nexus",
7-
#' trees are loaded using ape's \code{\link[pkg:ape]{read.nexus}} function. Otherwise, it's \code{\link[pkg:ape]{read.tree}}.
7+
#' trees are loaded using ape's \code{\link[ape]{read.nexus}} function. Otherwise, it's \code{\link[ape]{read.tree}}.
88
#' If a "format" argument is passed, type will be determined from the format definition.
99
#' @param format File format, which is used to find tree and log files.
1010
#' Currently accepted values are "mb" for MrBayes, "beast" for BEAST, "*beast" for *BEAST, and "revbayes" for RevBayes.
@@ -19,7 +19,7 @@
1919
#' read in with a skip value of 1. If no "skip" value is provided but a "format" is supplied, RWTY will
2020
#' attempt to read logs using the skip value from the format definition.
2121
#' @return output An rwty.chain object containing the multiPhylo and the table of values from the log file if available.
22-
#' @seealso \code{\link{read.tree}}, \code{\link{read.nexus}}
22+
#' @seealso \code{\link[ape]{read.tree}}, \code{\link[ape]{read.nexus}}
2323
#' @keywords Phylogenetics, MCMC, load
2424
#'
2525
#' @export load.trees

R/makeplot.acsf.cumulative.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ get.acsf <- function(freq.table){
9191

9292
get.csf <- function(freq.table){
9393
# get a df of absolute differences in pp variation between windows
94-
if(class(freq.table) == "rwty.slide"){
94+
if(inherits(freq.table, "rwty.slide")){
9595
dat = freq.table$slide.table
96-
}else if(class(freq.table) == "rwty.cumulative"){
96+
}else if(inherits(freq.table, "rwty.cumulative")){
9797
dat = freq.table$cumulative.table
9898
}else{
9999
stop("ERROR: unknown type of frequency table passed to process.freq.table()")

R/makeplot.splitfreqs.sliding.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ single.splitfreq.plot <- function(dat, rank){
9292
process.freq.table <- function(freq.table, n.clades, rank){
9393

9494
# strip out just the parts of a slide.freq.table or a cumulative.freq.table that we need
95-
if(class(freq.table) == "rwty.slide"){
95+
if(inherits(freq.table, "rwty.slide")){
9696
dat = freq.table$slide.table
97-
}else if(class(freq.table) == "rwty.cumulative"){
97+
}else if(inherits(freq.table, "rwty.cumulative")){
9898
dat = freq.table$cumulative.table
9999
}else{
100100
stop("ERROR: unknown type of frequency table passed to process.freq.table()")
@@ -116,10 +116,10 @@ process.freq.table <- function(freq.table, n.clades, rank){
116116
dat$clade = rownames(dat)
117117

118118

119-
if(class(freq.table) == "rwty.slide"){
119+
if(inherits(freq.table, "rwty.slide")){
120120
dat = melt(dat, id.vars=c("clade", "sd", "ess"))
121121
colnames(dat) = c("Clade", "StDev", "ESS", "Generations", "Split.Frequency")
122-
}else if(class(freq.table) == "rwty.cumulative"){
122+
}else if(inherits(freq.table, "rwty.cumulative")){
123123
dat = melt(dat, id.vars=c("clade", "sd", "wcsf"))
124124
colnames(dat) = c("Clade", "StDev", "WCSF", "Generations", "Split.Frequency")
125125
}

R/tree.dist.matrix.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@
122122
#' @keywords treespace tree-distance robinson-foulds
123123
#'
124124
#' @importFrom TreeDist ClusteringInfoDistance InfoRobinsonFoulds
125-
#' JaccardRobinsonFoulds MASTSize MASTInfo MatchingSplitInfoDistance NNIDist
126-
#' NyeSimilarity PathDist PhylogeneticInfoDistance SPRDist
125+
#' JaccardRobinsonFoulds MASTSize MASTInfo MatchingSplitDistance MatchingSplitInfoDistance
126+
#' NNIDist NyeSimilarity PathDist PhylogeneticInfoDistance SPRDist
127127
#' @export tree.dist.matrix
128128
#' @examples
129129
#' \dontrun{

man/load.trees.Rd

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)