Histogram in R

The histogram in R is used to represent variable values frequency. The difference between histogram and barplot is that histogram groups the values into continuous ranges. To create a histogram in R we used the hist() function. The height of the bars represents the frequency of that variable. The histogram takes a vector as input … Read more

Line Graph in R

The line graph in R has a line that connects all the points in a diagram. With the help of plot() functions you can create a line and add the type parameter with a value of ā€œlā€ in R programming: Output: Line Color To change the color you can use col parameter, remember the color … Read more

Analysis of Covariance

Analysis of Covariance is most important in statistics. To create models, we use Regression analysis which describes the effect of variation in predictor variables on the response variable. In some cases, if you have a categorical variable with values like Male/Female or Yes/No etc. Simple regression analysis gives several results for each value of the … Read more

Scatter Plot in R

The plot() function is used to plot numbers against each other. The scatter plot in R is used to show the relationship between two numerical variables. Here we need two vectors of the same length, one for the x-axis (horizontal) and one for the y-axis (vertical): Output The above example shows the result of 12 … Read more

Pie Chart in R

The pie chart is a circular graphical representation of data. You can draw a pie chart in R with help of the pie() function. Output The above pie chart draws one pie for each value (34,65,54,58,32) in the vector. The plotting of the first pie starts from the x-axis and move counterclockwise by default. Note: The size … Read more

Bar Chart in R

The bar chart in R uses rectangular bars to visualize the data. The height of the bars is proportional to the values they represent. The bar charts can be displayed either horizontally or vertically. By using the barplot() function a vertical bar chart is drawn: Output The above example shows: The x variable represents values in the … Read more

R Function

The R function is a set of statements that are organized together to perform a particular task. R language facilitates a series of built-in functions and permits to use to create their own functions. The modular approach is used to perform tasks in functions. Usually, functions are used to avoid repetition of the same task … Read more

R Classification

The R classification algorithm is a very easy task. By analyzing the training dataset we can predict the target class. We can obtain better boundary conditions that can be used to check the target class using the training dataset. The whole process is known as classification.  R Classification algorithms Some important points of R classification … Read more

Distribution in R

There are two types of distribution in R as follow: Normal Distribution Binomial Distribution Normal Distribution in R The random collection of data from independent sources is known as normal distribution in R. Now we know that we will get a bell shape curve if we plot a graph with the value of the variable … Read more

Excel File in R

The excel file extension that stores data in the .xls or xlsx format. There are several packages to perform the operations on an excel file in R programming. These packages are XLConnect, xlsx, gdata etc. Install xlsx Package You can use the following command in the R console to install the “xlsx” package. Verify and … Read more