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
Programming Articles - Page 878 of 3366
595 Views
To remove rows in R matrix that contains a specific number, we can follow the below steps −First of all, create a matrix.Then, use single square subsetting with apply function to remove rows that contains a specific number.ExampleCreate the data frameLet’s create a data frame as shown below −M
3K+ Views
To convert values greater than a threshold into 1 in R data frame column, we can follow the below steps −First of all, create a data frame.Then, use ifelse function to convert values greater than a threshold into 1.ExampleCreate the data frameLet’s create a data frame as shown below −x
419 Views
To subset R data frame rows if at least one or more values matches, we can follow the below steps −First of all, create a data frame.Then, use rowSums function along with sapply function and values for match to subset the data frame rows if at least one or more values matches.ExampleCreate the data frameLet’s create a data frame as shown below −x
3K+ Views
To repeat column values in R data frame by values in another column, we can follow the below steps −First of all, create a data frame.Then, use rep function along with cbind function to repeat column values in the matrix by values in another column.ExampleCreate the data frameLet’s create a data frame as shown below −x
3K+ Views
To standardize selected columns in R data frame, we can follow the below steps −First of all, create a data frame.Then, use scale function with subsetting to standardize selected columns.ExampleCreate the data frameLet’s create a data frame as shown below −v1
How to convert a data frame into two column data frame with values and column name as variable in R?
967 Views
To convert a data frame into two column data frame with values and column name as variable in R, we can follow the below steps −First of all, create a data frame.Then, use stack function to convert data frame.ExampleCreate the data frameLet’s create a data frame as shown below −x
123 Views
To extract number from string if string is in different format than normal in R data frame, we can follow the below steps −First of all, create a data frame.Then, use gsub function along with as.numeric function to extract the number.ExampleCreate the data frameLet’s create a data frame as shown below −x
423 Views
To remove repeated numbers in sequence in R data frame column, we can follow the below steps −First of all, create a data frame.Then, use diff function and subsetting with single square brackets to remove repeated numbers in sequence.Example 1Create the data frameLet’s create a data frame as shown below −x
441 Views
To split a factor variable into n number of variables equal to factor size with full length in R data frame, we can follow the below steps −First of all, create a data frame.Then, use mtabulate function of qdapTools package to split the factor variable.ExampleCreate the data frameLet’s create a data frame as shown below −factor