Nizamuddin Siddiqui has Published 2307 Articles

How to change the whisker line type in base R boxplot?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 28-Oct-2021 06:58:19

1K+ Views

The default boxplot in R has dotted whisker lines and if we want to change it to something else, we can use the whisklty argument.For Example, if we have a vector called X then we can create the boxplot of X with different whisker line by using the command boxplot(X, ... Read More

Create a number vector in R with initial values as zero by defining the maximum digits for each value.

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 27-Oct-2021 12:24:04

45 Views

To create a number vector in R with initial values as zero by defining the maximum digits for each value, we can use sprintf function.For Example, if we want to create a number vector having values starting from 1 to 100 and we want to have 1 as 001 and ... Read More

How to remove end lines from a boxplot in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 27-Oct-2021 12:19:07

506 Views

The default boxplot in R has straight lines that display end point(s) excluding outliers. To remove these end lines from a boxplot, we can use staplelty argument and set it to 0.For Example, if we have a vector called X then we can create the boxplot of X by using ... Read More

How to check if a data frame has any missing value in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 27-Oct-2021 12:13:21

1K+ Views

To check if a data frame has any missing value in R, we can use any function along with is.na function. For Example, if we have a data frame called df then we can use the below command to check whether df contains any missing value or notany(is.na(df))Example 1Following snippet ... Read More

Create a subset of non-duplicate values without the first duplicate from a vector in R.

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 27-Oct-2021 11:54:15

88 Views

Generally, the duplicate values are considered after first occurrence but the first occurrence of a value is also a duplicate of the remaining therefore, we might want to exclude that as well.The subsetting of non-duplicate values from a vector in R can be easily done with the help of duplicated ... Read More

How to create pie chart in base R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 27-Oct-2021 11:40:52

119 Views

A pie chart is a circular representation of data which is created for either nominal data or ordinal data. The slices in the pie chart depend on the magnitude of the data values. If we want to create a pie chart in base R then pie function can be used.For ... Read More

How to find the row products for each row in an R data frame?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 27-Oct-2021 11:26:13

191 Views

To find the row products for each row in an R data frame, we can use rowProds function of matrixStats package but we need to read the data frame as a matrix.For Example, if we have a data frame called df then we can find the row products for each ... Read More

Create a sample of data frame column by excluding NAs in R

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 27-Oct-2021 10:40:48

202 Views

To create a random sample by excluding missing values of a data frame column, we can use sample function and the negation of is.na with the column of the data frame.For Example, if we have a data frame called df that contains a column X which has some NAs then ... Read More

How to find the number of times array is rotated in the sorted array by recursion using C#?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 27-Aug-2021 13:47:21

240 Views

Find index of mid element (minimum element) Apply Binary Search on the subarray based on following conditions −If number lies between start element and element at mid1 position.Then find number in array start to mid-1 using binary searchElse if number lies between mid and last element, then find number in ... Read More

How to find the minimum number of steps needed by knight to reach the destination using C#?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 27-Aug-2021 13:40:34

217 Views

We have to make the knight cover all the cells of the board and it can move to a cell only once.There can be two ways of finishing the knight move - the first in which the knight is one knight's move away from the cell from where it began, ... Read More

Advertisements