top of page

R Scripting

BioCodeKb - Bioinformatics Knowledgebase

R is a programming language and free software environment for statistical computing and graphics supported by the R Foundation for Statistical Computing. The R language is widely used among statisticians and data miners for developing statistical software and data analysis in Bioinformatics. A scripting language is used to write scripts. These contain a series of commands that are interpreted one by one at runtime unlike programming languages that are compiled first before running. Nowadays, scripts are generally associated with web development where they are widely used to make dynamic web applications. Due to its data handling and modeling capabilities as well as its flexibility, R is becoming the most widely used software in bioinformatics. R Programming for Bioinformatics explores the programming skills needed to use this software tool for the solution of bioinformatics and computational biology problems. R is one of the most widely-used and powerful programming languages in bioinformatics. R especially shines where a variety of statistical tools are required (e.g. RNA-Seq, population genomics, etc.) and in the generation of publication-quality graphs and figures.

R scripts

While entering and running our code at the R command line is effective and simple. This technique has its limitations. Each time we want to execute a set of commands, we have to re-enter them at the command line. Complex commands are potentially subject to typographical errors, necessitating that they be re-entered correctly. Repeating a set of operations requires re-entering the code stream. Fortunately, R and RStudio provide a method to mitigate these issues.

A script is simply a text file containing a set of commands and comments. The script can be saved and used later to re-execute the saved commands. The script can also be edited so we can execute a modified version of the commands.

Creating an R script

It is easy to create a new script in RStudio. We can open a new empty script by clicking the New File icon in the upper left of the main RStudio toolbar. Clicking the icon opens the New File Menu. Click the R Script menu option and the script editor will open with an empty script.

We can save your script by clicking on the Save icon at the top of the Script Editor panel. When you do that, a Save File dialog will open.

Opening an R script

Opening a saved R script is easy to do. Click on the Open an existing file icon in the RStudio toolbar. A Choose file dialog will open.

Executing code in an R script

The Run button in the Script Editor panel toolbar will run either the current line of code or any block of selected code.

A comment in R code begins with the # symbol. All text after the # is treated as a comment and is ignored during execution.

Besides using comments to help make our R code more easily understood, we can use the # symbol to ignore lines of code while we are developing your code stream. Simply place a # in front of any line that you want to ignore. R will treat those lines as comments and ignore them.


  • R does not involve lots of pointing and clicking, and that’s a good thing

  • R script is great for reproducibility

  • R script is interdisciplinary and extensible

  • R script works on data of all shapes and sizes

  • R script produces high-quality graphics

  • Thousands of people use R script daily

BioinfoLytics Company

Our company BioinfoLytics is affliated with BioCode and is a project, where we are providing many topics on Genomics, Proteomics, their analysis using many tools in a better and advance way, Sequence Alignment & Analysis, Bioinformatics Scripting & Software Development, Phylogenetic and Phylogenomic Analysis, Functional Analysis, Biological Data Analysis & Visualization, Custom Analysis, Biological Database Analysis, Molecular Docking, Protein Structure Prediction and Molecular Dynamics etc. for the seekers of Biocode to further develop their interest to take part in these services to fulfill their requirements and obtain their desired results. We are providing such a platform where one can find opportunity to learn, research projects analysis and get help and huge knowledge based on molecular, computational and analytical biology.

We are providing “R Scripting” service to our researchers and seekers who can find free software environment for statistical computing and graphics studying and researching in fields of science.


Need to learn more about R Scripting and much more?

To learn Bioinformatics, analysis, tools, biological databases, Computational Biology, Bioinformatics Programming in Python & R through interactive video courses and tutorials, Join BioCode.

bottom of page