Nizamuddin Siddiqui has Published 2307 Articles

How to deal with missing values to calculate correlation matrix in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 08-Sep-2020 10:39:12

3K+ Views

Often the data frames and matrices in R, we get have missing values and if we want to find the correlation matrix for those data frames and matrices, we stuck. It happens with almost everyone in Data Analysis but we can solve that problem by using na.omit while using the ... Read More

How to increase the width of the lines in the boxplot created by using ggplot2 in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 08-Sep-2020 10:33:22

3K+ Views

When we create a boxplot using ggplot2, the default width of the lines in the boxplot is very thin and we might want to increase that width to make the visibility of the edges of the boxplot clearer. This will help viewers to understand the edges of the boxplot in ... Read More

How to find the number of distinct values in an R vector?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 07-Sep-2020 07:07:45

205 Views

When we have repeated elements in an R vector and the vector size is large then we might want to know the distinct values in that vector. This will help us to understand the unique values we have in our vector, so that we can create the appropriate chart and ... Read More

How to find the column and row indices of values in a matrix using which function in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 07-Sep-2020 07:02:15

1K+ Views

To find the row and column indices of values in a matrix, we cannot simply use which function because it returns the index based on sequence of the numbers in the matrix. For example, if we have a matrix M as below −1 2 3 4 1 6 7 8 ... Read More

How to extract values from an R data frame column that do not start and end with certain characters?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 07-Sep-2020 06:23:01

66 Views

Sometimes we just want to extract the values of a data column based on initial and ending values of a column that has strings or sometimes the values of a column that has strings are recorded with some extra characters and we want to extract those values. For this purpose, ... Read More

How to add a citation in a plot created by using ggplot2 in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 07-Sep-2020 06:20:48

1K+ Views

A footnote is generally used to give references to a document, text or image and it is called citation. It helps the reader or viewer to check out the original source using the new text or image is generated. If we want to give citation to a plot in R ... Read More

How to combine two vectors while replacing the NA values with the values in the other vector in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 07-Sep-2020 06:17:22

567 Views

Sometimes we have vectors with NA values, also there might be a situation that one of vector having an NA at a position and the other vector has the numerical values at the same position. For example, 1, 2, NA and 1, 2, 3. In this case, we might want ... Read More

How to multiply each element of a numerical vector in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 07-Sep-2020 06:11:26

2K+ Views

Sometimes we want to determine the multiplication of all the elements of a vector just like the sum. This might be required to test the changes in the mathematical operations that can be applied to a numerical vector. In base R, we have prod function which works same as sum ... Read More

How to concatenate numerical vectors and a string to return a string in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 07-Sep-2020 06:08:30

2K+ Views

In general, the concatenation of numerical vectors and string results in a vector of strings in R. For example, if we want to concatenate 1, 2, 3 with Tutorialspoint using paste function then it will result in a vector as: "Tutorialspoint 1" "Tutorialspoint 2" "Tutorialspoint 3". But if we want ... Read More

How to create an image of matrix of pixels in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 07-Sep-2020 06:04:30

702 Views

A matrix can be converted into a pixel’s image of matrix. It is defined as the area of the matrix which contains pixels with equal or different sizes of left, right, bottom and upper.We can create this by using image function and its argument useRaster with the matrix data.Example Live Demo> ... Read More

Advertisements