# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
#' Cumulative sum of uninterrupted '1'
#'
#'
#' @param x integer vector to be used
#'
#' @return integer vector
#'
#' @details
#' Returns a vector whose elements are the
#' cumulative sums of uninterrupted entries equal to 1 in an integer vector
#'
#' @examples
#'
#' x <- c(0,1,1,1,0,0,1,1,1,0,0)
#'
#' cumsum1(x)
#'
#'
#'
#'
#' @export
cumsum1 <- function(x) {
.Call(`_datatools_cumsum1`, x)
}
#' Creates a unique ID for all uninterrupted series in a vector
#'
#'
#' @param x numeric vector to be used
#' @param delta increment with default \code{delta}=0
#'
#' @return an integer vector
#'
#' @details
#' If x[t] = (x[t-1] + delta) then ID(x[t])=ID(x[t-1])
#' otherwise ID(x[t]) = ID(x[t-1]) + 1.
#'
#' @examples
#'
#' x <- c(0,1,1,1,2,2,1,3,1,0,0)
#' y <- c(1998:2000,2005:2010)
#'
#' make_series_id(y, delta=1)
#' make_series_id(x)
#'
#'
#'
#'
#' @export
make_series_id <- function(x, delta = 0) {
.Call(`_datatools_make_series_id`, x, delta)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.