Skip to content

Commit

Permalink
avoid removing data if nothing matches cycles filter
Browse files Browse the repository at this point in the history
  • Loading branch information
addisonklinke committed Apr 17, 2020
1 parent 9fc4017 commit c3c1b11
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion R/CountCycles.numeric.R
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,10 @@ CountCycles.numeric <- function(x) {
# Format and return
cycles <- as.data.frame(cycles)
cycles <- plyr::rename(cycles, c("V1" = "amplitude", "V2" = "mean", "V3" = "cycles"))
cycles <- cycles[-which(cycles$cycles == 0), ]
remove = which(cycles$cycles == 0)
if (length(remove) > 0) {
cycles <- cycles[-remove, ]
}
class(cycles) <- c("rainflow", "data.frame")
return(cycles)
}

0 comments on commit c3c1b11

Please sign in to comment.