- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- 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
3K+ Views
To convert a matrix column into list can be done by using the apply function. We will have to read the columns of the matrix as list by using as.list function. For example, if we have a matrix called M then the columns in M can be converted into list ... Read More
Nizamuddin Siddiqui
170 Views
Suppose we have a matrix and a vector containing indices of equal size as the matrix then we can extract the vector from matrix using the index vector. For this purpose, we can use cbind function as shown in the below examples.Example1Live Demo> M1 M1Output [, 1] [, ... Read More
Nizamuddin Siddiqui
908 Views
To aggregate matrix columns by row names, we can use colSums with sapply and transpose the output. For example, if we have a matrix called M then the aggregate matrix columns by row names can be done using t(sapply(by(M, rownames(M), colSums), identity)).Example1Consider the below matrix −Live Demo> M1 rownames(M1) M1Output ... Read More
Nizamuddin Siddiqui
1K+ Views
To find the location of a numerical value in an R data frame we use which function and if the value is string then the same function will be used but we need to pass the value appropriately. For example, if we have a data frame called df that contains ... Read More
Nizamuddin Siddiqui
2K+ Views
To find the correlation for data frame having numeric and non-numeric columns, we can use cor function with sapply and use complete.obs for pearson method. For example, if we have a data frame called then we can use the below command to find the correlation coefficient −cor(df[, sapply(df, is.numeric)], use="complete.obs", ... Read More
Nizamuddin Siddiqui
193 Views
A binary matrix contains values in form of twos such as 0/1, 1/2, Yes/No etc. If we have a matrix that has some values and we expect that there are only two values in the whole matrix then we can check whether only those two values exist in the matrix ... Read More
Nizamuddin Siddiqui
76 Views
If a matrix has multiple columns and values in each row are different then there will be number of maximums equal to the number of columns. Suppose, we want to extract the index of two maximums in each row in a matrix called M then we can use the below ... Read More
Nizamuddin Siddiqui
774 Views
To create a bar plot in R, we can use barplot function but if there exist some missing values in the data then we can use ggplot2 package. For example, if we have a data frame having two vectors say x and y, x containing categorical values with NA as ... Read More
Nizamuddin Siddiqui
203 Views
In data science, we often face the problem of missing values and we need to define a way to replace them with an appropriate value or we can complete remove them. If we want to replace the missing then we also need to know how many missing values are there. ... Read More
Nizamuddin Siddiqui
464 Views
The standardization of a numerical column can be easily done with the help of scale function but if we want to standardize multiple columns of a data frame if categorical columns also exist then mutate_if function of dplyr package will be used. For example, if we have a data frame ... Read More