# R/slicesDeprecated.R In lfl: Linguistic Fuzzy Logic

#### Documented in slices

```#' Return vector of values from given interval
#'
#' Returns an ordered vector of values from given interval, of given size,
#' generated by equal steps.
#'
#' Returns a vector of values from \code{from} to \code{to} (inclusive), with
#' equal difference between two consecutive values, with total length \code{n}.
#' Function is useful e.g. together with the \code{\link{pbld}} or
#'
#' @param from The lower bound of the interval.
#' @param to The upper bound of the interval.
#' @param n The length of the vector to be produced.
#' @return A vector of numbers in the given interval and size.
#' @author Michal Burda
#' @keywords models robust
#' @examples
#' \dontrun{
#'     slices(1, 5, 10) # 1, 1.5, 2, 2.5, 3, 3.5 4, 4.5, 5
#' }
#' # is the same as
#' seq(1, 5, length.out=10)
#'
#'
#' @export slices
slices <- function(from, to, n) {
.Deprecated('base::seq')
if (!is.numeric(from) && length(from) != 1) {
stop("'from' must be a numeric value")
}
if (!is.numeric(to) && length(to) != 1) {
stop("'to' must be a numeric value")
}
if (!is.numeric(n) && length(n) != 1) {
stop("'n' must be a numeric value")
}
if (n < 2) {
stop("'n' must be at least 2")
}
res <- 0:(n-1) / (n-1) * (to - from) + from
return(res)
}
```

## Try the lfl package in your browser

Any scripts or data that you put into this service are public.

lfl documentation built on Sept. 8, 2022, 5:08 p.m.