R/brainrange.R

Defines functions brainrange

Documented in brainrange

#' @title brainrange
#'
#' @description
#' creates a sequence of numbers from first to last by the given interval
#'
#'
#' @param first starting value number
#' @param last ending value
#' @param by amount to move by in sequence
#' @return vector of numbers
#'
#' @examples
#' brainrange(1,10,0.5)
#'
#' @export


brainrange <- function(first = 0, last = 1, by = 1) {
    i <- first - by
    final <- vector()
    while(i < last){
        i <- i + by
        final <- c(final, i)
    }
    a <- final[final <= last]
    return(a)
}

Try the brainImageR package in your browser

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

brainImageR documentation built on May 6, 2019, 3:54 a.m.