Flat 10% & upto 40% off + 10% Cashback + Free additional Courses. Hurry up

Basic Syntax, Data Types and Variables

In this chapter we will learn to write the simplest program of writing “Hello World” in R programming language. In this programme we will use function print() to display this string.

Basic Syntax Data Types and Variables

Usually the string will be displayed with double quotes. However in order to avoid that put, quote=FALSE.

Variables and Data Types in R Programming

Variables and Constants are two important concepts of R programming which form the fundamental of this language. This chapter will summarize the theory of these two terms along with small examples.


variables are similar to an open box, where you can put any value of your wish. You can change the values as well. One thing to be noted here that the variable name should be different from the reserved words. Some of the key points to be remembered while defining variables are-

  • Variable names can be a combination of letters, numbers, underscore, etc.
  • The names should start with a letter or a period, however in latter case, the period cannot be followed by a digit.
  • reserved words cannot be used as identifiers.


Constants can be defined as the entities whose values cannot be changed. Basically there are two types of constants:

  • Numeric constants – It includes all the numbers. Three basic types of these variables are integer, double, complex. The numeric constants which are followed with L are considered as integers and i are regarded as complex. On the other hand, the constants with 0x or 0X at the end are considered as hexadecimal.
  • Character constants – These constants are defined with single (‘ ‘) or double quotes (” “) known as delimiters.

Data Types

There are 5 data types in R Programming which are described below:

  • Numeric – Decimal values are referred to as numeric data type. For example, 1.23.
  • Integer – It includes the integer numbers. For example, 1, 2, 3.
  • Complex – It consists of complex numbers, such as, i+2.
  • Logical – Where logical operators are used. such as a<b.
  • Character – Represented using double quotes. For example, “123”.

"0 Responses on Basic Syntax, Data Types and Variables"

Leave a Message

100% Secure Payments. All major credit & debit cards accepted Or Pay by Paypal.

Sales Offer

  • To avail this offer, enroll before 24th January 2018.
  • This offer cannot be combined with any other offer.
  • This offer is valid on selected courses only.
  • Please use coupon codes mentioned below to avail the offer

Sign Up or Login to view the Free Basic Syntax, Data Types and Variables.