Nizamuddin Siddiqui has Published 2307 Articles

How to convert integers into integers written in words in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 08-Oct-2020 15:17:25

57 Views

If we have numbers then we might want to convert those numbers into words. For example, converting 1 to one. This might be required in cases where we have text data and numbers are part of the text. Therefore, it would be better to represent the numbers in text form ... Read More

How to set NA values to TRUE for a Boolean column in an R data frame?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 08-Oct-2020 15:14:58

670 Views

Dealing with NA values is one of the boring and almost day to day task for an analyst and hence we need to replace it with the appropriate value. If in an R data frame, we have a Boolean column that represents TRUE and FALSE values, and we have only ... Read More

How to fill the NA values from above row values in an R data frame?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 08-Oct-2020 15:06:47

664 Views

Sometimes we have missing values that can be replaced with the values on the above row values, it often happens in situations when the data is recorded manually and the person responsible for it just mention the unique values because he or she understand the data characteristics. But if this ... Read More

How to represent the mean with vertical line in a histogram created by hist function in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 08-Oct-2020 15:02:41

2K+ Views

The value of mean is an important characteristic of the data to be represented by a histogram, therefore, one might want to plot it with the histogram. If the histogram is created by using hist function then we can create a vertical line on the histogram with the help of ... Read More

How to find different elements between two string vectors in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 08-Oct-2020 15:00:01

822 Views

Just like numerical vectors, we can find the different elements between two string vectors if there exists any. For this purpose, we can use setdiff function. For example, if we have a vector V1 that contains a, b, c, d, e, f and the other vector V2 that contains a, ... Read More

How to find the sum of consecutive values considering two values each time in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 08-Oct-2020 14:58:05

479 Views

Finding the sum of consecutive value while considering the sum of two values each time means the sum of first two values, then the sum of second value and the third value, then the sum of third value and the fourth value, then the sum of fourth value and the ... Read More

How to create a horizontal bar chart using ggplot2 with labels at inside end of the bars in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 08-Oct-2020 14:53:42

3K+ Views

To create a horizontal bar chart using ggplot2 package, we need to use coord_flip() function along with the geom_bar and to add the labels geom_text function is used. These two functions of ggplot2 provides enough aesthetic characteristics to create the horizontal bar chart and put the labels at inside end ... Read More

How to find unique permutations if a vector contains repeated elements in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 08-Oct-2020 14:51:07

283 Views

We can use permn function from combinat package to find the permutations but if we have repeated elements in the vector then the result will not have unique permutations, therefore, we need to use unique function along with the permn function. For example, if we have a vector 1, 2, ... Read More

How to represent the legend in a plot created by using plot function with colored straight lines or stars in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 08-Oct-2020 14:48:44

137 Views

A legend helps us to differentiate between the type of values or any another division of values in a data set. These legends can be represented in many ways and two of these ways are straight lines and stars. To represent the legend in a plot created by using plot ... Read More

How to create a frequency polygon in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 08-Oct-2020 14:46:58

1K+ Views

Frequency polygons are the graphs of the values to understand the shape of the distribution of the values. They are useful in comparing different data sets and visualising cumulative frequency distribution of the data sets. In base R, we can use polygon function to create the frequency polygon but first ... Read More

Advertisements