Nizamuddin Siddiqui has Published 2307 Articles

How to standardize matrix elements in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 14-Oct-2020 12:00:25

984 Views

The standardization is the process of converting a value to another value so that the mean of the set of values from which the original value was taken becomes zero and the standard deviation becomes one. To standardize matrix elements, we can use data.Normalization function of clusterSim package but we ... Read More

How to change a data frame with comma separated values in columns to multiple columns in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 14-Oct-2020 11:44:18

735 Views

Mostly, we need to import the data from an outside source in R environment for analysis and these data can be recorded as comma separated values that represent rows. If we want to create the columns for the comma separated values then cSplit function of splitstackshape package can be used. ... Read More

How to create a boxplot with outliers of larger size in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 14-Oct-2020 11:32:18

3K+ Views

When we create a boxplot for a column of an R data frame that contains outlying values, the points for those values are smaller in size by default. If we want to increase the size for those outlying points then outlier.size argument can be used inside geom_boxplot function of ggplto2 ... Read More

How to add a mathematical expression in axis label in a plot created by using plot function in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 14-Oct-2020 11:30:02

418 Views

When we create a plot using plot function in R, the axes titles are either chosen by R automatically based on the vectors passed through the function or we can use ylab or xlab for particular axes. To add a mathematical expression in an axis label, we can use title ... Read More

How to create a black and white word cloud in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 14-Oct-2020 11:28:18

130 Views

According to Google, a word cloud is an image composed of words used in a particular text or subject, in which the size of each word indicates its frequency or importance. In R, we can create word cloud by using wordcloud function of wordcloud package. So, we have the same ... Read More

How to convert the repeated elements of strings in a vector to unique elements in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 14-Oct-2020 11:25:20

113 Views

When we have repeated elements of strings and we want to use them as factor levels then it is okay but if we want to treat them individually then it is better to make each value a unique element. To do this, we can use make.unique function. For example, if ... Read More

How to create a stacked bar plot with vertical bars in R using ggplot2?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 14-Oct-2020 11:17:31

407 Views

Traditionally, the stacked bar plot has multiple bars for each level of categories lying upon each other. But this visual can be changed by creating vertical bars for each level of categories, this will help us to read the stacked bar easily as compared to traditional stacked bar plot because ... Read More

How to subtract one data frame from another in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 14-Oct-2020 11:12:46

9K+ Views

If we have two data frames with same number of columns of same data type and equal number of rows then we might want to find the difference between the corresponding values of the data frames. To do this, we simply need to use minus sign. For example, if we ... Read More

How to create a list of an unordered combination of elements in a string vector in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 14-Oct-2020 10:05:56

115 Views

An unordered combination of elements means that the combination of the values in a way that does not make any particular arrangement. For example, if we have three values one, two, and three then they can be arranged in the following way which is unordered −"one" "two" "three" "one" "two" ... Read More

How to check whether a year or a vector of years is leap year or not in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 14-Oct-2020 10:04:26

320 Views

Almost everyone knows that a leap has 366 instead of 365 days and it occurs once in four years. If we want to check whether a particular year is a leap year or in a range of years which years correspond to leap year then we can use leap_year function ... Read More

Advertisements