Nizamuddin Siddiqui has Published 2307 Articles

How to select columns of an R data frame that are not in a vector?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 04-Sep-2020 08:17:38

331 Views

An R data frame can have so many columns and we might want to select them except a few. In this situation, it is better to extract columns by deselecting the columns that are not needed instead of selecting the columns that we need because the number of columns needed ... Read More

How to add a new column in an R data frame by combining two columns with a special character?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 04-Sep-2020 08:03:44

573 Views

A data frame can have multiple types of column and some of them could be combined to make a single column based on their characteristics. For example, if a column has characters and the other has numbers then we might want to join them by separating with a special character ... Read More

How to find the mean of corresponding elements of multiple matrices in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 04-Sep-2020 07:54:13

675 Views

If the elements of multiple matrices represent the same type of characteristic then we might want to find the mean of those elements. For example, if we have matrices M1, M2, M3, and M4 stored in a list and the first element represent the rate of a particular thing, say ... Read More

How to add a new column to represent the percentage for groups in an R data frame?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 04-Sep-2020 07:45:19

3K+ Views

In data analysis, we often need to find the percentage of values that exists in a data group. This helps us to understand which value occurs frequently and which one has low frequency. Also, plotting of percentages through pie charts can be done and that gives a better view of ... Read More

How to change the background color of a plot created by using plot function in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 04-Sep-2020 07:39:15

887 Views

To change the focus of a plot we can do multiple things and one such thing is changing the background of the plot. If the background color of a plot is different than white then obviously it will get attention of the readers because this is unusual as most of ... Read More

How to sort a vector in increasing order that contains numbers and characters in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 04-Sep-2020 07:35:05

128 Views

A vector can contain numbers, characters or both. The sorting of vectors that contain only numbers or only characters is not very difficult but if a vector contains both of them then it is a little tedious task. In R, we can sort a vector that contains numbers as well ... Read More

How to create a row at the end an R data frame with column totals?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 04-Sep-2020 07:32:57

180 Views

In data analysis, we often need column totals, especially in situations where we want to perform the analysis in a step by step manner. There are many analytical techniques in which we find the column totals such as ANALYSIS OF VARIANCE, CORRELATION, REGRESSION, etc. To find the column totals, we ... Read More

How to select the first and last row based on group column in an R data frame?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 04-Sep-2020 07:30:13

1K+ Views

Extraction of data is necessary in data analysis because extraction helps us to keep the important information about a data set. This important information could be the first row and the last row of groups as well, also we might want to use these rows for other type of analysis ... Read More

How to get the list of data sets available in base R or in a package in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 04-Sep-2020 07:27:32

7K+ Views

There are many data sets available in base R and in different packages of R. The characteristics of these data sets are very different, for example, some data sets are time series data, some have only numerical columns, some have numerical as well as factor columns, some includes character columns ... Read More

How to plot multiple time series using ggplot2 in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 04-Sep-2020 06:58:38

1K+ Views

For a one point of time, we might have multiple time series data, this could be weather for multiple cities, price variation in multiple products, demand expectancy at different locations, or anything that changes with time and measured for multiple things or locations. If we have such type of time ... Read More

Advertisements