Skip to content

Commit

Permalink
Changes for resubmission to CRAN
Browse files Browse the repository at this point in the history
  • Loading branch information
DomBennett committed Jun 22, 2017
1 parent f9399ae commit 527acb2
Show file tree
Hide file tree
Showing 12 changed files with 49 additions and 57 deletions.
2 changes: 1 addition & 1 deletion R/manip-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ pinTips <- function(tree, tids, lngs, end_ages, tree_age) {
spn_data[tree@all, 'end'] <- tmp_spn_data[['end']]
rm(tmp_spn_data)
rid <- tree@root
# add oldest to youngest
# add oldest to youngest
ordrd <- order(end_ages, decreasing=TRUE)
plyr::m_ply(ordrd, .pin)
tree
Expand Down
13 changes: 7 additions & 6 deletions R/node-declaration.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@
}

#' @name Node-class
#' @aliases Node-method
#' @param x \code{Node} object
#' @param object \code{Node} object
#' @param i slot name
#' @param j missing
#' @param ... missing
#' @param drop missing
#' @title Node-class
#' @description The \code{Node} is an S4 class used for displaying node information.
#' It is only generated when a user implements the \code{[[]]} on a tree. Information
Expand Down Expand Up @@ -57,28 +61,24 @@ setClass ('Node', representation=representation (
tip='logical') # T/F tip node?
)
#' @rdname Node-class
#' @aliases Node-method
#' @exportMethod as.character
setMethod ('as.character', c('x'='Node'),
function(x) {
paste0('Node Obj. [ID=', x@id, ']')
})
#' @rdname Node-class
#' @aliases Node-method
#' @exportMethod show
setMethod ('show', 'Node',
function(object){
cat(summary(object))
})
#' @rdname Node-class
#' @aliases Node-method
#' @exportMethod print
setMethod ('print', 'Node',
function(x){
print(summary(x))
})
#' @rdname Node-class
#' @aliases Node-method
#' @exportMethod summary
setMethod ('summary', c('object'='Node'),
function(object){
Expand Down Expand Up @@ -110,9 +110,10 @@ setMethod ('summary', c('object'='Node'),
cat(msg)
})

#' @rdname Node-class
#' @exportMethod [
setMethod('[', c('Node', 'character'),
function(x, i) {
setMethod('[', c('Node', 'character', 'missing', 'missing'),
function(x, i, j, ..., drop=TRUE) {
if(!i %in% slotNames(x)) {
stop(paste0(i, ' not in node'))
}
Expand Down
2 changes: 1 addition & 1 deletion R/server-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ searchTxnyms <- function (tree, cache=FALSE, parent=NULL, clean=TRUE,
#' @description Resolve taxonomic names via the Global Names Resolver.
#' @details Returns dataframe containing GNR metadata for each name wames
#' that cannot be resolved are returned as NA. Various datasources are
#' available, see \url{http://resolver.globalnames.biodinfo.org/data_sources} for a
#' available, see \url{http://resolver.globalnames.org/data_sources} for a
#' list and IDs. Default is 4 for NCBI.
#' @param nms vector of names
#' @param batch size of the batches to be queried
Expand Down
15 changes: 5 additions & 10 deletions R/treeman-declaration.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@

#' @name TreeMan-class
#' @title TreeMan-class
#' @aliases TreeMan-method
#' @description S4 class for representing phylogenetic trees as a list of nodes.
#' @param x \code{TreeMan} object
#' @param i node ID or slot name
#' @param object \code{TreeMan} object
#' @param max.level \code{str()} maximum number of levels to show
#' @param ... additional tree objects
#' @param j missing
#' @param drop missing
#' @slot ndlst list of nodes
#' @slot nds vector of node ids that are internal nodes
#' @slot nnds numeric of number of internal nodes in tree
Expand Down Expand Up @@ -101,7 +104,6 @@ setClass('TreeMan', representation=representation(

# Accessor methods
#' @rdname TreeMan-class
#' @aliases TreeMan-method
#' @exportMethod [[
setMethod('[[', c('TreeMan', 'character'),
function(x, i) {
Expand All @@ -124,10 +126,8 @@ setMethod('[[', c('TreeMan', 'character'),
.newNd(x, i)
})
#' @rdname TreeMan-class
#' @aliases TreeMan-method
#' @exportMethod [
setMethod('[', c('TreeMan', 'character'),
function(x, i) {
setMethod('[', c('TreeMan', 'character', 'missing', 'missing'),
function(x, i, j, ..., drop=TRUE) {
slt_nms <- slotNames(x)
slt_nms <- slt_nms[slt_nms != 'ndlst']
slt_nms <- slt_nms[slt_nms != 'ndmtrx']
Expand All @@ -151,30 +151,26 @@ setMethod('[', c('TreeMan', 'character'),

# display methods
#' @rdname TreeMan-class
#' @aliases TreeMan-method
#' @exportMethod as.character
setMethod('as.character', c('x'='TreeMan'),
function(x) {
paste0('TreeMan Object of [', length(x@tips),'] tips')
})
#' @rdname TreeMan-class
#' @aliases TreeMan-method
#' @exportMethod show
setMethod('show', 'TreeMan',
function(object){
msg <- as.character(object)
cat(msg)
})
#' @rdname TreeMan-class
#' @aliases TreeMan-method
#' @exportMethod print
setMethod('print', 'TreeMan',
function(x){
msg <- as.character(x)
print(msg)
})
#' @rdname TreeMan-class
#' @aliases TreeMan-method
#' @exportMethod str
setMethod('str', c('object'='TreeMan'),
function(object, max.level=2L, ...) {
Expand All @@ -184,7 +180,6 @@ setMethod('str', c('object'='TreeMan'),
str@default(object, max.level=max.level, ...)
})
#' @rdname TreeMan-class
#' @aliases TreeMan-method
#' @exportMethod summary
setMethod('summary', c('object'='TreeMan'),
function(object){
Expand Down
15 changes: 5 additions & 10 deletions R/treemen-declaration.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
#' @name TreeMen-class
#' @title TreeMen-class
#' @aliases TreeMen-method
#' @param x \code{TreeMen} object
#' @param i tree index (integer or character)
#' @param object \code{TreeMen} object
#' @param max.level \code{str()} maximum level
#' @param ... additional tree objects
#' @param j missing
#' @param drop missing
#' @description S4 class for multiple phylogenetic trees
#' @slot treelst list of \code{TreeMan} objects
#' @slot ntips sum of tips per tree
Expand Down Expand Up @@ -70,7 +73,6 @@ setGeneric("cTrees", signature=c("x"),
standardGeneric("cTrees")
})
#' @rdname TreeMan-class
#' @aliases TreeMan-method
#' @exportMethod cTrees
setMethod("cTrees", c("TreeMan"),
function(x, ...) {
Expand All @@ -80,7 +82,6 @@ setMethod("cTrees", c("TreeMan"),
x
})
#' @rdname TreeMen-class
#' @aliases TreeMen-method
#' @exportMethod cTrees
setMethod('cTrees', c('TreeMen'),
function(x, ...) {
Expand All @@ -90,7 +91,6 @@ setMethod('cTrees', c('TreeMen'),

# Accessor methods
#' @rdname TreeMen-class
#' @aliases TreeMen-method
#' @exportMethod [[
setMethod('[[', c('TreeMen', 'ANY'),
function(x, i) {
Expand All @@ -103,8 +103,8 @@ setMethod('[[', c('TreeMen', 'ANY'),
#' @aliases TreeMen-method
#' Extract slots from a list of trees
#' @exportMethod [
setMethod('[', c('TreeMen', 'character'),
function(x, i) {
setMethod('[', c('TreeMen', 'character', 'missing', 'missing'),
function(x, i, j, ..., drop=TRUE) {
if(!i %in% slotNames(x)) {
stop(paste0(i, ' not in tree'))
}
Expand All @@ -129,22 +129,19 @@ setAs(from="list", to="TreeMen", def=function(from, to) {

# display methods
#' @rdname TreeMen-class
#' @aliases TreeMen-method
#' @exportMethod as.character
setMethod('as.character', c('x'='TreeMen'),
function(x) {
paste0('TreeMen Object of [', x@ntrees,'] trees')
})
#' @rdname TreeMen-class
#' @aliases TreeMen-method
#' @exportMethod show
setMethod('show', 'TreeMen',
function(object){
msg <- as.character(object)
cat(msg)
})
#' @rdname TreeMen-class
#' @aliases TreeMen-method
#' @exportMethod str
setMethod('str', c('object'='TreeMen'),
function(object, max.level=2L, ...) {
Expand All @@ -154,15 +151,13 @@ setMethod('str', c('object'='TreeMen'),
str@default(object, max.level=max.level, ...)
})
#' @rdname TreeMen-class
#' @aliases TreeMen-method
#' @exportMethod print
setMethod('print', c('x'='TreeMen'),
function(x){
msg <- as.character(x)
print(msg)
})
#' @rdname TreeMen-class
#' @aliases TreeMen-method
#' @exportMethod summary
setMethod('summary', c('object'='TreeMen'),
function(object){
Expand Down
2 changes: 1 addition & 1 deletion R/update-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ updateSlts <- function(tree) {
#' @param ... \code{as.big.matrix()} additional arguments
#' @seealso
#' \code{\link{updateSlts}}, \code{\link{rmNdmtrx}},
#' \url{https://cran.r-project.org/web/packages/bigmemory/index.html}
#' \url{https://cran.r-project.org/package=bigmemory}
#' @export
#' @examples
#' # library(treeman)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# treeman
[![Build Status](https://travis-ci.org/DomBennett/treeman.svg)](https://travis-ci.org/DomBennett/treeman)[![Coverage Status](https://coveralls.io/repos/DomBennett/treeman/badge.svg?branch=master&service=github)](https://coveralls.io/github/DomBennett/treeman?branch=master)[![CRAN downloads](http://cranlogs.r-pkg.org/badges/grand-total/treeman)](https://cran.r-project.org/web/packages/treeman/index.html)[![Rdoc](http://www.rdocumentation.org/badges/version/treeman)](http://www.rdocumentation.org/packages/treeman)
[![Build Status](https://travis-ci.org/DomBennett/treeman.svg)](https://travis-ci.org/DomBennett/treeman)[![Coverage Status](https://coveralls.io/repos/DomBennett/treeman/badge.svg?branch=master&service=github)](https://coveralls.io/github/DomBennett/treeman?branch=master)[![CRAN downloads](http://cranlogs.r-pkg.org/badges/grand-total/treeman)](https://CRAN.R-project.org/package=treeman)[![Rdoc](http://www.rdocumentation.org/badges/version/treeman)](http://www.rdocumentation.org/packages/treeman)

> An R package for manipulating phylogentic trees using an intuitive S4 class structure.
Expand Down
14 changes: 10 additions & 4 deletions man/Node-class.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 9 additions & 12 deletions man/TreeMan-class.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 7 additions & 9 deletions man/TreeMen-class.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/addNdmtrx.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 527acb2

Please sign in to comment.