Nizamuddin Siddiqui has Published 2307 Articles

How to replace $ sign combined with some specific values in an R data frame?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 19-Nov-2020 08:15:03

72 Views

Sometimes we get very dirty data and that is the reason data analysis is a difficult task. Most of the data scientists look for clean data but it is almost impossible due to data warehouses often just focus on the data availability instead of the quality of data. One of ... Read More

How to find the 95% confidence interval for the glm model in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 19-Nov-2020 08:12:21

6K+ Views

To find the confidence interval for a lm model (linear regression model), we can use confint function and there is no need to pass the confidence level because the default is 95%. This can be also used for a glm model (general linear model). Check out the below examples to ... Read More

How to convert the X-axis label in a bar plot to italic using ggplot2 in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 19-Nov-2020 08:09:53

754 Views

Obviously, the default font of axes-labels is not italic in R just like any other statistical analysis tool but we can make it using ggplot2. For this purpose, we can use theme function of ggplot2 package where we have an option to change the font of the axis labels using ... Read More

How to find the correlation matrix for a data frame that contains missing values in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 19-Nov-2020 08:07:29

389 Views

To find the correlation matrix for a data frame, we can use cor function with the data frame object name but if there exist missing values in the data frame then it is not that straight forward. In such type of situations, we can use complete.obs with the cor function ... Read More

How to generate orthogonal polynomials in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 19-Nov-2020 08:05:29

498 Views

We can say that orthogonal is a synonym of perpendicular. If the inner product (inner product is generalization of dot product) of two polynomials is zero then we call them orthogonal polynomials. In R, we can find the orthogonal product by using poly function as shown in the below examples.Example1Live ... Read More

How to create boxplot using mean and standard deviation in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 19-Nov-2020 08:02:00

8K+ Views

The main statistical parameters that are used to create a boxplot are mean and standard deviation but in general, the boxplot is created with the whole data instead of these values. If we don’t have whole data but mean and standard deviation are available then the boxplot can be created ... Read More

How to create a 3D-array from data frame in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 19-Nov-2020 08:00:35

2K+ Views

A 3D-array is a 3-dimensional array and it is actually a collection of 2D arrays. We can create a 3D-array of a data frame in R by using simplify2array function, this function will break the data frame into arrays that will form a 3D-array.Example1Consider the below data frame:Live Demo> set.seed(254) ... Read More

How to create frequency table of a string vector in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 19-Nov-2020 07:58:44

990 Views

To create a frequency table of a string vector, we just need to use table function. For example, if we have a vector x that contains randomly sampled 100 values of first five English alphabets then the table of vector x can be created by using table(x). This will generate ... Read More

How to create QR code in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 19-Nov-2020 07:55:50

1K+ Views

A QR code is a barcode which is used to read the information about the object on which it is printed. This helps us to detect the useful information relevant to the object so that we can proceed with the next step depending on the operation. In R, we can ... Read More

How to create a duplicate column in an R data frame with different name?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 19-Nov-2020 07:53:36

1K+ Views

The easiest way to create a duplicate column in an R data frame is setting the new column with $ sign and if we want to have a different name then we can simply pass a new name. For example, if we have a data frame df that contains a ... Read More

Advertisements