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

tapply function in R with examples

tapply function in R

In this tutorial, we will discuss about tapply() function in R with some examples. tapply() function is available in base R package. The tapply() function in R The tapply() function is very useful to aggregate the data. That is tapply() function allows us to create a group summaries based on factor levels. The general syntax …

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

lapply Function in R with Examples

lapply function in R

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

Read more