×
Home
Jobs
Tools
Coding Ground
Current Affairs
UPSC Notes
Online Tutors
Whiteboard
Net Meeting
Tutorix
Login
Packages
Categories
Java
JSP
iOS
HTML
Android
Python
C Programming
C++ Programming
C#
PHP
CSS
Javascript
jQuery
SAP
SAP HANA
Data Structure
RDBMS
MySQL
Mathematics
8085 Microprocessor
Operating System
Digital Electronics
Analysis of Algorithms
Mobile Development
Front End
Web Development
Selenium
MongoDB
Computer Network
General Topics
Library
Videos
Q/A
eBooks
Login
Library
Videos
eBooks
Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
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
1100
Answers
How to find the number of occurrences of unique and repeated characters in a string vector in R?
R Programming
Server Side Programming
Programming
Nizamuddin Siddiqui
Published on 05-Jan-2021 10:46:01
To find the number of occurrences of unique characters in a string vector, we can use table function with the combination of rle and strsplit. For example, if we have a string vector x that contains some unique and repeated values then it can be created by using the below ...
Read More
How to set the X-axis labels in histogram using ggplot2 at the center in R?
R Programming
Server Side Programming
Programming
Nizamuddin Siddiqui
Published on 05-Jan-2021 10:44:51
The boundary argument of geom_histogram function and breaks argument of scale_x_continuous function can help us to set the X-axis labels in histogram using ggplot2 at the center. We need to be careful about choosing the boundary and breaks depending on the scale of the X-axis values. Check out the below ...
Read More
How to create horizontal legend using ggplot2 in R?
R Programming
Server Side Programming
Programming
Nizamuddin Siddiqui
Published on 05-Jan-2021 10:43:13
The default legend direction is vertical but it can be changed to horizontal as well and for this purpose we can use legend.direction argument of theme function of ggplot2 package. For example, if we want to create a bar chart with x as categories and y as frequencies tjat are ...
Read More
How to remove names from a named vector in R?
R Programming
Server Side Programming
Programming
Nizamuddin Siddiqui
Published on 05-Jan-2021 10:40:12
To assign names to the values of vector, we can use names function and the removal of names can be done by using unname function. For example, if we have a vector x that has elements with names and we want to remove the names of those elements then we ...
Read More
How to convert a string vector into title case in R?
R Programming
Server Side Programming
Programming
Nizamuddin Siddiqui
Published on 05-Jan-2021 10:38:33
We cannot be sure about the data characteristics we get for analysis and mostly it is not well organised, thus, the first task would be to make it more organised. The string values not in title case should also be taken care of if it is especially supposed to be ...
Read More
How to set a specific value for a range in an R vector?
R Programming
Server Side Programming
Programming
Nizamuddin Siddiqui
Published on 05-Jan-2021 10:35:46
Suppose we have a vector that contains hundred values starting from 1 to 100 and we want to set values greater than 5 and less than 96 to 5 then it can be done with the help of ifelse function. For example, if such vector is named as x then ...
Read More
How to find the number of positive values in an R vector?
R Programming
Server Side Programming
Programming
Nizamuddin Siddiqui
Published on 05-Jan-2021 10:34:20
We know that positive values are greater than 0, therefore, we can use this condition with length function to find the number of positive values in a vector. For example, if we have a vector x that contains some positive and some negative values and we want to find the ...
Read More
How to check if all values in a vector are integer or not in R?
R Programming
Server Side Programming
Programming
Nizamuddin Siddiqui
Published on 05-Jan-2021 10:33:06
To check whether all values in a vector in R are integer or not, we can round the vector using floor function then subtract the vector values from it and check whether the output is zero or not. If the output will be zero that means the value is integer ...
Read More
How to convert a matrix into a data frame with column names and row names as variables in R?
R Programming
Server Side Programming
Programming
Nizamuddin Siddiqui
Published on 05-Jan-2021 10:31:36
To convert a matrix into a data frame with column names and row names as variables, we first need to convert the matrix into a table and then read it as data frame using as.data.frame. For example, if we have a matrix M then it can be done by using ...
Read More
How to create an empty data frame with fixed number of rows and without columns in R?
R Programming
Server Side Programming
Programming
Nizamuddin Siddiqui
Published on 05-Jan-2021 10:30:17
To create an empty data frame with fixed number of rows but no columns, we can use data.frame function along with the matrix function. That means we need to create a matrix without any column using matrix and save it in a data frame using data.frame function as shown in ...
Read More
1
2
3
4
5
6
7
...
110
Next
Advertisements
Print
Add Notes
Bookmark this page
Report Error
Suggestions
Save
Close
Dashboard
Logout