Nizamuddin Siddiqui has Published 2303 Articles

How to convert all words of a string or categorical variable in an R data frame to uppercase?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 11-Aug-2020 13:19:16

357 Views

Most of the times the format of the data we get is not we are looking for therefore, we need to change that according to our need. When the levels of categorical variables are represented by words instead of numbers then we can convert those levels to lowercase or to ... Read More

How to select rows with group wise minimum or maximum values of a variable in an R data frame using dplyr?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 11-Aug-2020 13:15:01

2K+ Views

If an R data frame contains a group variable that has many group levels then finding the minimum and maximum values of a discrete or continuous variable based on the group levels becomes difficult. But this can be done with slice function in dplyr package.Consider the below data frame that ... Read More

How to split a data frame in R into multiple parts randomly?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 11-Aug-2020 13:01:29

2K+ Views

When a data frame is large, we can split it into multiple parts randomly. This might be required when we want to analyze the data partially. We can do this with the help of split function and sample function to select the values randomly.ExampleConsider the trees data in base R ... Read More

How to convert empty values to NA in an R data frame?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 11-Aug-2020 12:58:17

746 Views

When our data has empty values then it is difficult to perform the analysis, we might to convert those empty values to NA so that we can understand the number of values that are not available. This can be done by using single square brackets.ExampleConsider the below data frame that ... Read More

How to remove empty rows from an R data frame?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 11-Aug-2020 12:54:43

718 Views

During the survey or any other medium of data collection, getting all the information from all units is not possible. Sometimes we get partial information and sometimes nothing. Therefore, it is possible that some rows in our data are completely blank and some might have partial data. The blank rows ... Read More

How to select columns in R based on the string that matches with the column name using dplyr?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 11-Aug-2020 12:48:03

1K+ Views

Selection of columns in R is generally done with the column number or its name with $ delta operator. We can also select the columns with their partial name string or complete name as well without using $ delta operator. This can be done with select and matches function of ... Read More

How to select the first row for each level of a factor variable in an R data frame?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 11-Aug-2020 12:37:42

633 Views

Comparison of rows is an influential part of data analysis, sometimes we compare variable with variable, value with value, case or row with another case or row, or even a complete data set with another data set. This is required to check the accuracy of data values and its consistency ... Read More

How to create line chart for all columns of a data frame a in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 11-Aug-2020 12:33:23

272 Views

To check the trend of all columns of a data frame, we need to create line charts for all of those columns. These line charts help us to understand how data points fall or rise for the columns. Once we know the trend, we can try to find the out ... Read More

How to find the index of the minimum and maximum value of a vector in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 11-Aug-2020 12:26:53

471 Views

While doing the data exploration in an analytical project, we sometimes need to find the index of some values, mostly the indices of minimum and maximum values to check whether the corresponding data row has some crucial information or we may neglect it. Also, these values sometimes transformed to another ... Read More

How to find the number of days and number of weeks between two dates in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 11-Aug-2020 09:20:30

443 Views

In data analysis, time series is one of the common data we have to deal with and it might also contain dates data along with other variables. We might want to find the difference between two times to check how many days or weeks have changed the time series. This ... Read More

Advertisements