Skip to content

Commit

Permalink
Laurent fix
Browse files Browse the repository at this point in the history
  • Loading branch information
philouail committed Mar 20, 2024
1 parent 29449bf commit 0a5e52c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions R/force_sorted.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@
#'
#' @examples
#' x <- c(NA, NA, NA, 1.2, 1.1, 1.14, 1.2, 1.3, NA, 1.04, 1.4, 1.6, NA, NA)
#' sorted_vec <- force_sorted(x)
#' is.unsorted(x, na.rm = TRUE)
#' y <- force_sorted(x)
#' is.unsorted(y, na.rm = TRUE)
#'
#' ## Vector non increasing at the end
#' x <- c(1, 2, 1.5, 2)
#' sorted_rtime <- force_sorted(x, by = 0.1)
#' is.unsorted(x, na.rm = TRUE)
#' y <- force_sorted(x, by = 0.1)
#' is.unsorted(y, na.rm = TRUE)
#'
#' ## We can see the values were not interpolated but rather replaced by the
#' ## last increasing value `2` and increasing by 0.1.
#' sorted_vec
#' y
#'
#' @export
#'
Expand All @@ -57,7 +57,7 @@ force_sorted <- function(x, by = .Machine$double.eps) {
warning("Found decreasing values at the end of the vector. ",
"Interpolation is not possible in this region. Instead, ",
"replacing these values with a sequence that starts from ",
"the last increasing value and increments by ", by,
"the last increasing value and increments by ", by,
". See help for more details")
break
}
Expand Down
10 changes: 5 additions & 5 deletions man/force_sorted.Rd

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

0 comments on commit 0a5e52c

Please sign in to comment.