User Defined Functions in R Part I

User-defined functions in R Part I

In this tutorial, you will learn about what is user-defined function in R and how to create user-defined function in R. You will also learn about how the function is evaluated in R. What are functions in R? For every programming language, functions are the building blocks. Basically, functions are used to incorporate set of …

Read more

Built-in Statistical Functions in R

Built-in statistical functions in R

In this tutorial, you will learn about some built-in statistical functions in R and how to use them. Built-in Statistical Functions in R Some of the commonly used built-in statistical function in R are listed below: Function Operation Performed sum(x) Sum of elements of x prod(x) Product of elements of x mean(x) Mean of x …

Read more

Built-in Character Functions in R

Built-in character functions in R

Built-in Character Functions in R In earlier tutorials we have seen that how to create character vector in R which contains character strings. To manipulate strings or character vectors, R has many built in functions for characters. Function Description nchar() Get the length of string toupper(x) Convert to Upper case tolower(x) Convert to Lower case …

Read more

Precedence of Operators in R

Precedence of operators in R

In this tutorial you will learn about the precedence of operators in R programming language. Precedence of Operators in R Precedence of operators in programming language is the order in which the expression is evaluated. When more than one operators are used in an expression, we need to know the order in which the expression …

Read more

Miscellaneous Operators in R

Miscellaneous operators in R

Apart from the regular arithmetic, logical and relational operators, R has some miscellaneous operators. In this tutorial you will learn about the miscellaneous operators in R with examples. Miscellaneous Operators in R In R, miscellaneous operators are used for special purposes like data frame column selection, generating sequences, model formula, matrix multiplication, etc. Following symbols …

Read more

Logical Operators in R

Logical Operators in R

In this tutorial you will learn about the logical operators in R with examples. Like most of the programming languages, R programming also has logical operators to perform Boolean operations. Logical Operators in R Following symbols are used as logical operators in R programming language: Operator Symbols Logical Operation Example ! Logical negation NOT ! …

Read more

sapply Function in R with Examples

sapply function in R

In this tutorial, we will discuss about sapply() function in R with some examples. sapply() function is available in base R package. sapply() function in R The sapply() function takes a vector, list or data frame, an index and a function (built-in or user-defined function) as inputs. The sapply() function is similar to lapply() function, …

Read more

Built-in Trigonometric functions in R

Built-in trigonometric functions in R

Trigonometric functions are the part of built-in mathematical functions. All these functions are vectorised. In this tutorial you will learn some built-in trigonometric functions in R and how to use these trigonometric functions in R. Built-in Trigonometric functions Commonly used trigonometric functions in R are listed below: Function Operation Performed sin(x) sine value of x …

Read more

Built-in Mathematical Functions in R

Built-in mathematical functions in R

Like other programming languages, R programming language also has various built-in mathematical functions to perform mathematical calculations. All these functions are vectorised. In this tutorial you will learn what are the built-in mathematical functions in R and how to use mathematical functions in R. Built-in Mathematical Functions in R Some commonly used built-in mathematical functions …

Read more