How to make Boxplots in R

R Boxplots Boxplot is a measure of how well the data is distributed in a data set. It is used to give a summary of one or several numeric variables. The line that divides the box into two parts represents …

How to create Histograms in R

R Histograms A Histogram is the graphical representation of the distribution of numeric data. It takes only one numeric variable as input. The variable is cut into several bars (also called bins), and the number of observation per bin is …

R Line Graphs

Line graph or line chart is a graph that connects a series of points by drawing segments between them. A line graph represents the relationship between 2 variables. These points are ordered in one of their coordinates (usually the x- …

R Inheritance

One the main concept of object oriented programming is inheritance which allows us to define a new class of existing classes. This means that we can derive new classes from existing base classes and adding new features. Hence, inheritance provides …

R Pie Charts

R programming language provides many numbers of libraries to create charts and graphs. A pie-chart is a representation of data as slices of a circle with different colors representing counts or proportions. Each slice is labeled and the numbers corresponding …

R Loops

Loops are used to repeat a certain set of actions so you don’t have to perform them repeatedly. Suppose you want to perform operation 10 times, if you start writing the code for each time, the program’s length increases and …

R Switch Statement

It is an alternate way to a nested if…else statement. A switch statement permits an expression to be tested against a list of case values. In short, we can say that a switch statement is used to compare an expression …

R If Else Statement

If statement It is the most simple decision-making statement. It checks the condition if the condition is true then only it will execute the block of statements written in the ‘if statement’. Syntax:

First of all, it will check …

R Bar Charts

Bar charts represent data in the form of rectangular bars. In R, we can create bar charts using barplot() function. We can supply a matrix or vector to this function.  R supports both vertical and horizontal bars in the bar …

R S3 Class

S3 class implements a style of OO (Object Oriented) programming called generic- function OO. This is totally different from most programming languages, like C++, Java, and C# which implement message passing OO. With message passing messages or methods are sent …

R S4 Class

S4 class is similar to S3 but is more formal and improvement over the S3 class. There are two major differences between S3 and S4. S4 has formal class definitions, which define the representation and inheritance for each class, and …

R XML Files

XML stands for Extensible Markup Language. It is a file format which shares both file format and data on the WWW, intranets, and elsewhere using ASCII text. It is a popular choice for storing large amounts of complex data. It …

R Lists

R List is a collection of R-objects which contains elements of different types like – strings, numbers, vectors and another list inside it. A list can also contain function or a matrix as its elements. Creating a list In R, …

R Vectors

Vector is a sequence of data elements of the same type. It is a one dimensional array. Members of a vector are known as components. There are five classes of vectors: Numeric Integer Complex Logical Character Creating a Vector Single …

R Variables, Constants and Reserved Words

R Variables Variables are very similar to an open box, where you can put any value of your wish. We can change the values as well. Variables are used to store data. A variable in R is used to store …

R Packages

Building and installing an R package In R Programming, packages are a collection of functions, data sets and compiled code. Packages are used to collect sets of R functions into a single unit. The directory where packages are stored is …

R JSON File

JSON stands for JavaScript Object Notation. It is a lightweight format for storing and transporting data. JSON file is often used when data is sent from a server to a web page. It often stores data as text in human …

R Factors

Factors are the R data objects. It is used to categorize the data and store it as levels. They can store both integers and strings. Factors are used in data analysis for statistical modeling. factor() function is used to create …

R Excel Files

Microsoft Excel is the spreadsheet program which stores data in the .xls and .xlsx format. R has the facility to read directly from these files using some excel specific packages. Some excel packages are: XLConnect, xlsx, gdata, RODBC, RExcel, etc. …

R Data Reshaping

In R programming, data reshaping is the process of changing the way data is organized into rows and columns. Most of the time data processing is done by taking the input data as a data frame. Sometimes we need data …