% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Seq.R
\name{Seq}
\alias{Seq}
\title{Smart Sequence Generation}
\usage{
Seq(from, to, decreasing = 0)
}
\arguments{
\item{from}{the starting value of the sequence}

\item{to}{the ending value of the sequence}

\item{decreasing}{= 1 to generate the decreasing sequence}
}
\description{
Smart Sequence Generation
}
\details{
This function is defined as
\preformatted{
  from-1 + seq_len(max(0,to-from+1))
}
so that
when \code{from > to} \code{Seq( from, to )} returns \code{numeric(0)}.

Basically, same as
\preformatted{
Seq <- function(from, to) {
  if (from <= to) {
     return(from:to)
  } else {
     return(numeric(0))
  }
}
}
}
\examples{
cat("Seq(3,5)\n")
for( i in Seq(3,5) ) print(i)
cat("Seq(5,3)\n")
for( i in Seq(5,3) ) print(i)
cat("seq(5,3)\n")
for( i in seq(5,3) ) print(i)
cat("\nSeq(3,5, decreasing=1)\n")
for( i in Seq(3,5, decreasing=1) ) print(i)
cat("Seq(5,3, decreasing=1)\n")
for( i in Seq(5,3, decreasing=1) ) print(i)

}
