Skip to content

Commit

Permalink
Allow zero_to_one input values to be symmetric around zero
Browse files Browse the repository at this point in the history
  • Loading branch information
envest committed Dec 14, 2021
1 parent 341eb77 commit ee619da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/tdm.R
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ log_transform_p1 = function(data = NULL, file = NULL) {
zero_to_one = function(data) {
# If the data are already all 0, then do nothing.
# If the data are all the same, then stop.
if(sum(data)==0) {
if(all(data==0)) {
return(as.vector(rep(0.0, length(data))))
}else if(min(data) == max(data)){
return(as.vector(rep(0.0, length(data))))
Expand Down

0 comments on commit ee619da

Please sign in to comment.