R/start_end_sequencer.R

Defines functions start_end_sequencer

Documented in start_end_sequencer

#' start_end_sequencer
#'
#' Get a set of sequences for starting and ending a sequence
#' @param df The dataframe you want to sequence
#' @param increment How much you want your sequence to increment by. Defaults to 100
#' @export

start_end_sequencer <- function(df,increment=100) {

  require(tidyverse)

  start <- seq(from=1,to=nrow(df),by=increment)
  end <- seq(from=increment,to=nrow(df),by=increment)

  if (!nrow(df) %in% end) {

    end <- c(end,nrow(df))
  }

  requests <- tibble(start_request = start,
                     end_request = end)

  return(requests)

}
neugelb/neugelbtools documentation built on July 7, 2020, 1:17 a.m.