Skip to content

Commit

Permalink
fix bug labelling rows of count and na_count
Browse files Browse the repository at this point in the history
was incorrectly labelling after filtering instead of before
  • Loading branch information
grlloyd committed Aug 7, 2019
1 parent 3b81868 commit ce49049
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions R/filter_na_count.R
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ setMethod(f="method.apply",
count[,k]=apply(D$data,2,function(x) sum(is.na(x[IF==L[k]])))
}
colnames(na_count)=L
colnames(count)=L
rownames(na_count)=colnames(D$data)
rownames(count)=colnames(D$data)

flags=apply(na_count,1,function(x) any(x<M$threshold))

Expand All @@ -88,11 +91,8 @@ setMethod(f="method.apply",
M$filtered=D
M$flags=data.frame(flags=flags)
M$count=as.data.frame(na_count)
rownames(count)=colnames(D$data)
colnames(count)=L
M$na_count=as.data.frame(count)
rownames(na_count)=colnames(D$data)
colnames(na_count)=L

return(M)
}
)

0 comments on commit ce49049

Please sign in to comment.