Skip to content
Snippets Groups Projects
Select Git revision
  • f13231e0654d8564b1511da6c83ff66e719713ad
  • master default protected
  • feature/quantileforecast
  • develop
  • add_kseq
5 results

lagvec.Rd

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    lagvec.Rd 638 B
    % Generated by roxygen2: do not edit by hand
    % Please edit documentation in R/lagvec.R
    \name{lagvec}
    \alias{lagvec}
    \title{Lag by shifting}
    \usage{
    lagvec(x, lag)
    }
    \arguments{
    \item{x}{The vector to lag}
    
    \item{lag}{(integer) The steps to lag.}
    }
    \value{
    The shifted vector
    }
    \description{
    Lag by shifting the vecter
    }
    \details{
    A positive value of \code{lag} shifts the values to the right in the vector.
    }
    \examples{
    
    # The values are simply shifted
    # Ahead in time
    lagvec(1:10, 3)
    # Back in time
    lagvec(1:10, -3)
    # Works but returns a numric
    lagvec(as.factor(1:10), 3)
    # Works and returns a character
    lagvec(as.character(1:10), 3)
    
    }