R Programming

R ia an open source programming language and provides an environment for statistical computing and graphics. R provides a wide variety of statistical techniques including but not limited to linear modelling, non linear modelling, time series analysis, classification clustering etc. 

Before digging into R programming concepts, ensure that the R is installed in the workstation and an IDE such as R-Studio can be optionally installed.

  1. Installing R in Windows
  2. Installing R-Studio in Windows

The following sections describe in brief all the R programming constructs required to start programming, performing basic tasks and gain enough knowledge to start learning on your own. This is a starter kit with an objective to expose the user to the fundamentals of R programming which can then be leveraged for exploring the advanced topics.

R Programming Language Fundamentals

Comments in R

R supports only single line comments that start with the symbol # followed by the comment text. If there is a need for a long comment, the comment needs to be broken into multiple lines each comment line starting with an individual # symbol.

#This is a comment

#Multiline comments or long comments need to be broken into multiple single
#line comments as shown here

The comments are not executed/ processed by the interpreter and are ignored when encountered. There is an inelegant work around to include multiline text that can be construed as comment but in fact is a false loop that is processed with no impact on the program.

if(FALSE) {
      "Multiline comment text enclosed in either single or double quotes can be 
       written inside this block. This is processed but since the validation 
       always evaluates to false, its never executed and has no impact on the program"