The R Programming language introduced a new technique called Recursion for elegant and straightforward coding. Recursive functions in R means a function calling itself. To understand the R recursive functions programming, let us consider a well know, yet simple example called factorial. We can calculate the factorial of any givenContinue Reading

Functions in R Programming Functions in R Programming is a block of code or some logic wrapped inside the curly braces { }, which performs a specific operation. In this R Programming tutorial journey, We have already seen some functions, and you may not notice them. For instance, print, abs,Continue Reading

A loop statement allows us to execute a statement or group of statements multiple times and the following is the general form of a loop statement in most of the programming languages − R For Loop The R For Loop is used to repeat a block of statements until thereContinue Reading

R Switch syntax The basic syntax of the Switch in R Programming language is switch (Expression, “Option 1”, “Option 2”, “Option 3”, ….., “Option N”) Bit complicated syntactical approach of the Switch statement in r is: switch (Expression, “Option 1” = Execute these statements when the expression result match Option 1, “OptionContinue Reading

In the real programming world, the R If Statement is the primary decision-making statement. R If Statement tests the condition first, and depending upon the result, executes the statements. If the test condition is true, then only statements within the if block executed. R If Statement Syntax The syntax ofContinue Reading

R Operators Operators can be categorized based upon their different functionality: Arithmetic Operators Logical Operators Relational Operators Assignment Operators Miscellaneous Operator Arithmetic Operators Arithmetic operations simulate various math operations, like addition, subtraction, multiplication, division and modulo using the specified operator between operands, which maybe either scalar values, complex numbers orContinue Reading

A variable is a memory allocated for storage of specific data and the name associated with the variable is used to work around this reserved block. The name given to a variable is known as its variable name. Usually a single variable stores only the data belonging to a certainContinue Reading

Data Types Unlike SAS and SPSS, R has several different data types (structures) including vectors, factors, data frames, matrices, arrays, and lists. The data frame is most like a dataset in SAS. 1. Vectors A vector is an object that contains a set of values called its elements. Numeric vectorContinue Reading

What data types exist in R? There are the 6 most common data types in R: Numeric Integer Complex Character Factor Logical Datasets in R are often a combination of these 6 different data types. Below we explore in more detail each data types one by one, except the dataContinue Reading

R Command Prompt Once you have R environment setup, then it’s easy to start your R command prompt by just typing the following command at your command prompt − $ R This will launch R interpreter and you will get a prompt > where you can start typing your programContinue Reading