
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Nizamuddin Siddiqui has Published 2307 Articles

Nizamuddin Siddiqui
403 Views
To display anything different than the vector or column names on the axes, we need to use xlab for X-axis and ylab for Y-axis. Therefore, if we want to display raise to the power on X-axis then xlab argument will be along with the plot function. For example, if we ... Read More

Nizamuddin Siddiqui
1K+ Views
To create the bar plot using ggplot2, we simply need to use geom_bar function and if we want to have the log scale of y variable then it can be set with aes under geom_bar. For example, if we have a data frame called df that contains a categorical column ... Read More

Nizamuddin Siddiqui
585 Views
To find the significant correlation in an R data frame, we would need to find the matrix of p-values for the correlation test. This can be done by using the function rcorr of Hmisc package and read the output as matrix. For example, if we have a data frame called ... Read More

Nizamuddin Siddiqui
570 Views
To get the color name from color code, we can use the color_id function of plotrix package. If we have a vector of colour codes say x then the colour name can be found by using the command sapply(x, color.id).ExampleLive Demo> x xOutput[1] "#FF0000" "#FF1F00" "#FF3D00" "#FF5C00" "#FF7A00" "#FF9900" "#FFB800" ... Read More

Nizamuddin Siddiqui
850 Views
To extract the unique combination of rows, we can subset the data frame with single square brackets and use the negation of the duplicated function after sorting the rows in the data frame. The sorting of the data frame can be done with the help of apply function and we ... Read More

Nizamuddin Siddiqui
2K+ Views
To find the row sum for each column by row name, we can use rowsum function. For example, if we have a matrix called M then the row sums for each column with row names can be calculated by using the command rowsum(M, row.names(M)).Example1Live Demo> M1 rownames(M1) colnames(M1) M1Output ... Read More

Nizamuddin Siddiqui
473 Views
In ggplot2, by default the legend title is the title of the grouping column of the data frame. If we want to change that title then scale_color_discrete function. For example, if we have a data frame called df that contains two numerical columns x and y and one grouping column ... Read More

Nizamuddin Siddiqui
571 Views
When we have two factor columns and one numeric column then we can create a contingency table for the total count of numeric values based on the factor columns. This can be done with the help of xtabs function in base R. For example, if we have a data frame ... Read More

Nizamuddin Siddiqui
454 Views
The grouping of values can be done in many ways and one such way is if we have duplicate values or unique values then the group can be set based on that. If all the values are unique then there is no sense for grouping but if we have varying ... Read More

Nizamuddin Siddiqui
643 Views
There is no in-built function to find the mode in R, hence we need to create one and then apply it to the rows of the matrix. The function for mode is created as follows −mode M1 M1Output [, 1] [, 2] [, 3] [, 4] [, 5] [1, ... Read More