lapply() Function in R: How to Use lapply() Method

R lapply - How to Use lapply() Function in R Programming

The apply() function is bundled with the R package. The apply() function can be feed with many functions to perform repetitive operations on a collection of objects (data frame, list, vector, etc.). The apply() functions form the basis of more complex combinations and helps to perform operations with very few lines of code. More specifically, … Read more

R Factor and Factor Levels: How to Create Factors in R

R Factor and Factor Levels - How to Create Factors in R

Factors are the list of unique values that are stored as integers. Factors are beneficial in data analysis for statistical modeling. Factors are data structures used for fields that take only predefined, a finite number of values (categorical data).  R Factor Factors in R are the data objects used to categorize the data and store … Read more

What is Subsetting in R and How to Subset 1D or 2D Data

What is Subsetting in R and How to Subset the Data

Subsetting means selecting the data from either a one-dimensional object like LETTERS or a two-dimensional object like DataFrame. You can select the data based on simple indexing, slicing and apply logical operators to get specific values. What is Subsetting in R Subsetting in R is a robust indexing feature to access object elements. Subsetting is used … Read more

Vector Math in R Programming Language

Vector Math in R Programming Language

A vector is a primary data type in R  that contains elements of the same type. Vector has a property length through which you can count the number of elements in the vector.  To check the vector’s data type, use typeof() function. How to Create Vector in R To create a Vector in R, use … Read more

R While Loop: How to Use While Loop in R

R While Loop - How to Use While Loop in R

The While loop executes the same code continuously until the stop condition returns TRUE. A loop is a statement that keeps running until a condition becomes FALSE.  R While loop The while loop in R executes continuously until the loop breaks or met the condition that ends the loop. The while loop control statement will … Read more