How to Replace NA values with Column Mean

One of the ways to deal with missing values (or NAs) is to replace them with mean values (under certain assumptions). The process is called imputation. In this tutorial, we will learn how to replace missing values (NAs) with column mean. First we will create some data with missing values and then show how to… Continue reading How to Replace NA values with Column Mean

colSums in R – compute sum of all columns in a dataframe or matrix

In this tutorial, we will learn about colSums() function in base R and use it to calculate sum of all columns in a matrix or a dataframe. We will see two examples to understand the use colSums() function. First, we will calculate sum of all columns in a matrix and dataframe with no missing values… Continue reading colSums in R – compute sum of all columns in a dataframe or matrix

How to Replace NA values in a dataframe with Zeros?

How to replace all NAs with Zeros

In this tutorial, we will learn how to replace all NA values in dataframe with a specific value like zero in R. Create a dataframe with NA values Let us get started with creating a dataframe with missing values,i.e. NAs in columns. We first create a vector with NAs using sample() function, where we sample… Continue reading How to Replace NA values in a dataframe with Zeros?

How to find installed R version from RStudio

How to find the version of R using version command

In this tutorial, you will learn three different ways to identify the version of R installed in your computer. Find R version from console after opening RStudio One of the ways to find the R version that you are using is to look at the console when you open R either using R app or… Continue reading How to find installed R version from RStudio

Exit mobile version