Nizamuddin Siddiqui has Published 2307 Articles

How to write a long line for the X-label of a scatterplot in R using ggplot2?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 21-Aug-2020 06:38:43

66 Views

When we create a plot in R, the variable names are automatically plotted as axes labels but sometimes we want to give a brief detail of the X-label or a Y-label. If that brief is not small so that the expression function can contain the length of the label then ... Read More

How to reverse a vector in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 21-Aug-2020 06:34:16

644 Views

Sometimes the vector values are recorded in the reverse order in R, therefore, we need to again reverse those vectors to get the actual order we want. For example, a sequence of numbers might be recorded as 1 to 20 but we wanted it to be from 20 to 1. ... Read More

How to a split a continuous variable into multiple groups in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 21-Aug-2020 06:32:27

637 Views

Splitting a continuous variable is required when we want to compare different levels of a categorical variable based on some characteristics of the continuous variable. For example, creating the salary groups from salary and then comparing those groups using analysis of variance or Kruskal-Wallis test. To split a continuous variable ... Read More

How to split a long string into a vector of substrings of equal sizes in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 21-Aug-2020 06:29:39

319 Views

If a vector is recorded as a single string by mistake or the file that contains the data did not separated the string in an appropriate way then we might need to split in the correct form so that we can proceed with the further analysis. This might happen when ... Read More

How to visualize the normality of a column of an R data frame?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 21-Aug-2020 06:28:32

103 Views

The first step to analyze a variable is checking whether it is normally distributed or not and to visually do this, we create a histogram. If the histogram depicts a bell then we consider that the variable is normally distributed otherwise, it is not. We can create a histogram for ... Read More

How to create a bar plot in R with label of bars on top of the bars using ggplot2?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 21-Aug-2020 06:25:03

390 Views

There are multiple ways to represent a chart, specifically a bar plot is represented with so many variations. We can also include bar labels in a bar plot so that the viewer can easily understand the frequency of the categories for bars. To put the labels on top of the ... Read More

How to create a new data frame for the mean of rows of some columns from an R data frame?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 21-Aug-2020 06:22:16

696 Views

Finding row means help us to identity the average performance of a case if all the variables are of same nature and it is also an easy job. But if some of the columns have different type of data then we have to extract columns for which we want to ... Read More

How to add or multiply each element of a matrix to the corresponding element of another matrix in R, if these matrices are stored as a list?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 21-Aug-2020 06:20:14

95 Views

Basic mathematical operations such as addition, subtraction, multiplication, and division are common for matrices and we often do that but if the matrices are stored as a list in R then these basic calculations are done differently as they are not direct objects. To add or multiply the matrices in ... Read More

How to create a line chart for a subset of a data frame using ggplot2 in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 21-Aug-2020 06:17:33

507 Views

Subsetting is not a difficult thing in R but if we make our code short then it is a little tedious task because we will have to introduce code between codes and that creates confusion. Therefore, we must be very careful while writing a code inside another code. To create ... Read More

How to create a Venn diagram in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 21-Aug-2020 06:11:50

350 Views

A Venn diagram helps to identify the common and uncommon elements between two or more than two sets of elements. This is also used in probability theory to visually represent the relationship between two or more events. To create a Venn diagram in R, we can make use of venn ... Read More

Advertisements