Ranges and plots in R

Functions in R can commonly accept a range of values and will return a corresponding vector with the outcome.

Explanation
Ranges can be defined using either the colomn (:) or the sequence function

Example

\begin{verbatim}
x <- 1:5
x <- -1:5
x <- (-1):5
x <- –(1:5)
\end{verbatim}


Examples
f <- function(x) {return(x*12)}
x <- seq (-5,5,0,1)
y <- f(x)
plot {(x,y) type= 'l'}
\begin{xmpl}
\begin{lstlisting}
f <- function(x) {return(x*12)}
x <- seq (-5,5,0,1)
y <- f(x)
plot {(x,y) type= 'l'}
\end{lstlisting}
\end{xmpl}