Skip to content

Commit

Permalink
Fix bug in transform_sample_counts()
Browse files Browse the repository at this point in the history
  • Loading branch information
mikemc authored Nov 8, 2019
1 parent 3fb790f commit d38e7e4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/transform_filter-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ setMethod("t", signature("phyloseq"), function(x){
#' head(otu_table(x4), 10)
transform_sample_counts <- function(physeq, fun, ...){
# Test the user-provided function returns a vector of the same length as input.
if( !identical(length(fun(1:10)), 10L) ){stop("`fun` not valid function.")}
if( !identical(length(fun(1:10, ...)), 10L) ){stop("`fun` not valid function.")}
# Check orientation, transpose if-needed to make apply work properly.
if( taxa_are_rows(physeq) ){
newphyseq = apply(as(otu_table(physeq), "matrix"), 2, fun, ...)
Expand Down

0 comments on commit d38e7e4

Please sign in to comment.