Skip to content

Commit

Permalink
[add] ntrees to summary
Browse files Browse the repository at this point in the history
  • Loading branch information
dokato committed May 28, 2021
1 parent ffa4065 commit ad9f2ca
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion R/summary.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ summary.neuronlist<-function(object, ..., include.attached.dataframe=FALSE) {
#'
#' \item{cable.length}
#'
#' \item{n.trees}
#'
#' }
#' @export
#' @examples
Expand All @@ -50,7 +52,8 @@ summary.neuron<-function(object, ...) {
segments=object$NumSegs,
branchpoints=length(object$BranchPoints),
endpoints=length(object$EndPoints),
cable.length=total_cable(object))
cable.length=total_cable(object),
n.trees=ifelse("nTrees" %in% names(object), object$nTrees, 1))
}

#' @export
Expand Down
2 changes: 2 additions & 0 deletions man/summary.neuron.Rd

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

2 changes: 1 addition & 1 deletion tests/testthat/test-summary.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ context("summary")

test_that("summary.neuronlist behaves", {
expect_is(s <- summary(Cell07PNs), 'data.frame')
expect_equal_to_reference(s, file = 'testdata/summary_cell07pns.rda', tolerance=1e-3)
expect_equal_to_reference(s, file = 'testdata/summary_cell07pns.rds', tolerance=1e-3)
expect_is(summary(kcs20, veclength=1.2), 'data.frame')
})

Expand Down
Binary file removed tests/testthat/testdata/summary_cell07pns.rda
Binary file not shown.
Binary file added tests/testthat/testdata/summary_cell07pns.rds
Binary file not shown.

0 comments on commit ad9f2ca

Please sign in to comment.