In this tutorial, we will learn how to use cbind() function in R. The cbind() function in the R programming language is used to combine vectors, matrices, or data frames by columns. cbind() stands for column bind as it combines by column. The basic syntax for using cbind() is … [Read more...] about How to use cbind() function in R
How to use outer function in R
In this tutorial, we will learn how to use outer() function in R. The outer() function in R is a useful tool for applying a function to all pairs of elements of two input vectors. The basic syntax of using outer() function is this Here X and Y are vectors and default … [Read more...] about How to use outer function in R
How to use dollar $ operator in R
R programming language uses $ operator (dollar operator) for extracting or accessing elements from data structures like list or dataframe. For example, with $ operator we can select specific elements of a list or dataframe by their names instead of their position. In this … [Read more...] about How to use dollar $ operator in R
How to compute mean in R
In this tutorial, we will learn how to use mean() function in R to compute mean (or average) of a vector. In the most basic use case, mean() function takes a vector as input argument and computes arithmetic mean of the elements in the vector In R, we can learn more about … [Read more...] about How to compute mean in R
How to calculate cumulative sum in R
In this tutorial, we will learn how to calculate cumulative sum in R. With cumsum() function in base R, we. can compute cumulative sum of a vector in R. We will first see two examples of using cumsum() on a vector to compute cumulative sum and then we will compute cumulative … [Read more...] about How to calculate cumulative sum in R