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

Mode in R: How to Find Mode of Vectors in R

Mode in R - How to Find Mode of Vectors in R

The mode in R is the value that has the highest number of occurrences in a set of data. Unlike the mean and median, the mode can have both numeric and character data. Mode in R To calculate mode in R, you have to define the user-defined function. In R, mean() and median() are standard … Read more

Mean in R: How to Find Mean of Vectors in R

Mean in R - How to Find Mean of Vectors in R

Statistical functions take the R vector as an input besides the arguments and give the result. R has many inbuilt statistical functions, and mean() is one of them. The mean of an observation variable is a numerical measure of the prime location of the data values. Mean is the sum of its data values divided by data count. … Read more

Sum in R: How to Find Sum of Vectors in R

Sum in R - How to Find Sum of Vectors in R

To calculate the sum of vectors in R, use the sum() function. The sum() method returns the sum of all the elements present in its arguments. If it is a vector, then it will return the sum of all vector elements. Sum in R The sum() function in R calculates the sum of a numeric … Read more

If else in R: How to Use if-else Statement

If else in R

If statement can be followed by the optional else statement, which executes when the boolean expression is FALSE. If the boolean expression evaluates TRUE, then the if block will be executed; otherwise, the else block will be executed. You can make a decision in R programming using the conditional If…Else statement. If-else statements are control structures in any programming … 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