thej022214 / corHMM

Fits a generalized form of the covarion model that allows different transition rate classes on different portions of a phylogeny by treating rate classes as “hidden” states in a Markov process.
11 stars 13 forks source link

Suggestion: function "makeSimmap" return class "multiSimmap" #39

Closed Caetanods closed 2 years ago

Caetanods commented 2 years ago

Function "makeSimmap" return object of class "list". Adding "multiSimmap" to the class can make interaction with "phytools" simpler.

Solution:

class_to_append <- ifelse(test = nSim > 1, yes = "multiSimmap", no = "simmap")
class(obj) <- append(class(obj), class_to_append)
return(obj)
jboyko commented 2 years ago

Dearest Dr. Caetano, ahem https://github.com/thej022214/corHMM/blob/6cfa4c94e48f93c310e49e7127c67aa3f0348927/R/makeSimmap.R#L47

Actually though, I think the newest version does this. Unless I misunderstand what you're asking.

Caetanods commented 2 years ago

Awesome! I am using the RCran version.