Nizamuddin Siddiqui has Published 2307 Articles

Create a graph without background panel using ggplot2 in R.

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 12-Nov-2021 03:45:36

132 Views

To create a graph without background panel, we can use theme function of ggplot2 package where we can set panel.background argument to blank.For Example, if we have a data frame called df that contains two columns say x and y then we can create scatterplot between x and y without ... Read More

Create a graph using ggplot2 without axes ticks and axes labels.

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 12-Nov-2021 03:44:32

89 Views

To create a graph using ggplot2 without axes ticks and axes labels, we can use theme function where we can use set axes ticks and axis labels to blank with the help of arguments corresponding to each axes such as axis.ticks.x, axis.ticks.y, axis.text.x, and axis.text.y.To understand how it works, check ... Read More

How to display a variable with subscript ggplot2 graph in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 12-Nov-2021 03:43:22

837 Views

Sometimes we have variables that have a subscript associated with them. This subscript is used to define the characteristics of the variable or to differentiate similar variables from each other.In this type of situation, displaying a variable with subscript in a graph created with the help of ggplot2 can be ... Read More

How to display tilde ggplot2 graph in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 12-Nov-2021 03:40:50

251 Views

Let’s say we want to display tilde sign at a particular position in histogram using ggplot2 graph. In this situation, we can use geom_text function and pass all the text with label argument inside aes where tilde will be written as %~%.For Example, if we want to display X follows ... Read More

How to create a circle with vertical lines in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 12-Nov-2021 03:14:20

182 Views

We can create a circle in R by using draw.circle function of plotrix package and if we want to have vertical lines inside the circle then density and angle arguments will be used. The density argument will create the lines and angle argument will set the direction of those lines.For ... Read More

How to create a 90-degree arc in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 12-Nov-2021 03:12:32

205 Views

To create a 90-degree arc in R, we can use draw.arc function of plotrix package where we can use deg2 argument. Since, a 90-degree can be drawn in four ways; we need to pass the degree depending on the position of the arc we want to display.Check out an Example ... Read More

How to create a circle with different color border in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 12-Nov-2021 03:09:39

348 Views

We can create a circle in R by using draw.circle function of plotrix package and default border color of the circle is black. If we want to change the border color of a circle then we can use border argument and pass the desired colors.For Example, if we want to ... Read More

How to fill bars of a bar plot created using ggplot2 with colors based on frequency?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 12-Nov-2021 03:05:54

756 Views

To fill bars in a bar plot using ggplot2 in R with colors based on frequency, we can use fill argument with count.For Example, if we have a data frame called df that contains a single column X that contains repeated values and we want to create bar plot of ... Read More

How to create a matrix with equal rows in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 11-Nov-2021 08:26:43

613 Views

If we have a single row for a matrix then creation of a matrix with equal rows can be easily done with the help of rep function and if we do not have the row then we would need to pass the row value inside rep function.Check out the below ... Read More

How to impute missing values by random value for a single column in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 11-Nov-2021 08:19:48

642 Views

To impute missing values by random value for a single column in R, we can use impute function from Hmisc package.For example, if we have a data frame called that contains a column say C which has some missing values then we can use the below given command to fill ... Read More

Advertisements