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

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

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

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

Matrix in R

The rectangular dataset in two dimensions is called a matrix in R programming. A matrix is created with a vector input to the matrix function. Mathematical operations can be performed like add, subtract, multiply, and division on a matrix in R programming. Elements are arranged in a fixed number of rows and columns in the … Read more

Arrays in R

Arrays in R can have more than two dimensions as compared to the matrix. Arrays in R, are created using the array() function. The array() function takes the vector as input and used its values in dim parameters to create an array. Suppose, we create an array of (2, 3, 4) dimensions, it will create … Read more

List in R

The list in R contains several unique data types inside it. A collection of data that is ordered and editable is called a list in R. We used the list() function to create a list: Output Access List in R To access the list items, refer to its index number inside brackets. The first item has index … 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

Data Types in R

The variable in the R language has a data type. All data types in R programming need some memory and have some operations that can be performed over it. We have the following data types in R programming: 1. Numeric data type in R The decimal values in the R language are called numeric. It … Read more

R Vector

The R vector is a list of items that are of the same type. The c() function is used to combine the list of items to a vector after separating the items by a comma. Below example shows a vector variable language, that combines strings: Output In this example, we create a vector that combines numerical … Read more