
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
Found 33676 Articles for Programming

875 Views
When we create boxplots for multiple categories in R using boxplot function, by default the X-axis labels are represented by numbers. But we might want to express the categories by their name. In this situation, we can use names argument along with the boxplot function.Consider the below vectors that represent different categories and create the boxplot for these categories −ExampleClass1
How to change the color of bars in histogram for values that are greater than 0 or less than 0 in R?

292 Views
Although, the histogram represents the distribution of a complete set of values but we might want to visualize that histogram based on the division of some threshold value. For example, we might want to visualize the histogram with different bars that have values greater than 1 or less than 1. This will help us to understand the distribution of the values in whole data set that lies above or below certain value. For this purpose, we can simply use hist function with col argument to change the color of the values that are greater than or less than a fixed ... Read More

6K+ Views
The residual variance is the variance of the values that are calculated by finding the distance between regression line and the actual points, this distance is actually called the residual. Suppose we have a linear regression model named as Model then finding the residual variance can be done as (summary(Model)$sigma)**2.Examplex1

1K+ Views
In general, the scatterplot is used to visualize the relationship between two columns of an R data frame but if we want to display the two columns separately not as a pair then we need to use matplot function. This function will create a plot for all the values in the two columns and represent them by their column number.Consider the below data frame −Example Live Demoset.seed(222) x

1K+ Views
The standardization is the process of converting a value to another value so that the mean of the set of values from which the original value was taken becomes zero and the standard deviation becomes one. To standardize matrix elements, we can use data.Normalization function of clusterSim package but we need to make sure that we set the type argument to n1 because that corresponds to standardization with mean zero and standard deviation 1.Loading clusterSim package −library("clusterSim")Example Live DemoM1

894 Views
Mostly, we need to import the data from an outside source in R environment for analysis and these data can be recorded as comma separated values that represent rows. If we want to create the columns for the comma separated values then cSplit function of splitstackshape package can be used. In the below example, we have created a data frame with comma separated values then splitting those values as single value in each column.Consider the below data frame −Example Live Demodf=data.frame(x=apply(matrix(rpois(200, 10), 20, 10), 1, paste, collapse=", ")) dfoutputx 1 8, 12, 7, 12, 10, 8, 11, 6, 8, 7 2 ... Read More

4K+ Views
When we create a boxplot for a column of an R data frame that contains outlying values, the points for those values are smaller in size by default. If we want to increase the size for those outlying points then outlier.size argument can be used inside geom_boxplot function of ggplto2 package.Consider the below data frame −Example Live Demoset.seed(1231) x

598 Views
When we create a plot using plot function in R, the axes titles are either chosen by R automatically based on the vectors passed through the function or we can use ylab or xlab for particular axes. To add a mathematical expression in an axis label, we can use title function with expression function to define the mathematical expression.Consider the below vectors and create scatterplot between the two −Exampleset.seed(111) x

195 Views
According to Google, a word cloud is an image composed of words used in a particular text or subject, in which the size of each word indicates its frequency or importance. In R, we can create word cloud by using wordcloud function of wordcloud package. So, we have the same name of the function as the package, thus we should not get confused by it.Loading wordcloud package and creating a wordcloud −library("wordcloud") x

188 Views
When we have repeated elements of strings and we want to use them as factor levels then it is okay but if we want to treat them individually then it is better to make each value a unique element. To do this, we can use make.unique function. For example, if we have a vector x that contains repeated string values then to make them unique, we can use make.unique(x).Example Live Demox1