In this tutorial, we will learn how to compute means of rows with tidyverse using dplyr package. We will see multiple examples to compute row means with dplyr. Wee will start with 3. examples of computing row means using rowMeans() and dplyr's row-wise operations on a dataframe … [Read more...] about How to Compute row means
How to compute row means in R
In this tutorial, we will learn about rowMeans() function in base R and use it to calculate mean of all rows in a matrix or a dataframe. We will see two examples to understand the use rowMeans() function. First, we will calculate mean of all rows in a matrix and dataframe with no … [Read more...] about How to compute row means in R
How to replace NAs with zero in a dataframe
In this post we will learn how to replace NAs, i.e. missing values with zeros in data frame in R. With tidyr's replace_na() function, we can replace NAs in specific columns of a dataframe to zero or any other specific value. We will start with learning how to use replace_na() … [Read more...] about How to replace NAs with zero in a dataframe
How to compute inverse of a matrix in R
In this tutorial, we will show how to compute inverse of matrix in R. Computing inverse of a matrix is core to multiple applications. In linear algebra, inverse of a matrix is defined as a matrix that, when multiplied by the original matrix, results in the identity matrix. … [Read more...] about How to compute inverse of a matrix in R
tidyr unite(): combine multiple columns into one
In this tutorial, we will learn how to use unite() function in tidyr package to combine multiple columns into a single column. By combining , we mean to concatenate the values of two or more columns separated by a delimiter like underscore. We will start with combining two … [Read more...] about tidyr unite(): combine multiple columns into one