R Constants

In this tutorial you will learn about the R Constants and its application with practical example.

R Constants

Constants refers to immutable values. Constants are basically literals whose values cannot be modified or changed during the execution of program. In R, constants can be of following types –

Table Of Contents

Numeric constants

It includes all the numeric data types including integer, double, complex. All the numeric constants followed by L are considered as integers and those followed by i are regarded as complex. The constants with 0x or 0X are considered as hexadecimal.

Example:-

Character constants

Character constants are defined with pair of single (‘ ‘) or double quotes (” “).

Example:-

In this tutorial we have learn about the R Constants and its application with practical example. I hope you will like this tutorial.