Modularity

Modularity involves designing a system that is divided into a set of functional units (named modules) that can be composed into a larger application. \\

Any programming project should be split into logical module pieces of code which are combined into a complete program.

Details
Typically input, initialization, analysis, and output commands are grouped into separate parts.
Examples
\begin{xmpl}
Input
\begin{lstlisting}
dat<-read.table("http://notendur.hi.is/[…]/set115.dat", header=T)
cols<- c("le", "osl")
\end{lstlisting}

Analysis
\begin{lstlisting}
Mn<-mean(dat[, cols[1]])
\end{lstlisting}


Output
\begin{lstlisting}
print (Mn)
\end{lstlisting}
\end{xmpl}