Dplyr is a grammar for data manipulation in R. By constraining the options, dplyr helps you to think about Your data manipulation challenges Solve those challenges through program and Execute those programs We will make use of the data consisting of Flights that Departed NYC in 2013 from the CRAN. If you have already gone … Continue reading Using Dplyr for Manipulating Data in R
Category: R-programming
Working with Plotly in R
Plotly lets users easily create interactive charts and dashboards to share online with their audience. Plotly for R is based on the open source library plotly.js. The plotly.js charts are shipped with zoom, pan, hover, and click interactions. You can click-and-drag to zoom into a region, double-click to autoscale, click on legend items to toggle … Continue reading Working with Plotly in R
Understanding different visualization layers of ggplot
Ggplot2 is a system for 'declaratively' creating graphics, based on "The Grammar of Graphics". The ggplot works on the philosophy of adding layers to the visualization to visualize your data effectively. It has 7-layers grammatical elements as shown below: In this article, we will use mtcars inbuilt data frame to understand various aspects of ggplot. … Continue reading Understanding different visualization layers of ggplot
Working with Functions in R
Like it happens in any programming language, functions enable to enclose related lines of code into a reusable block. Values can be passed to the functions in the form of parameters and received from the functions using return values. In R, function have the following syntax: function.name <- function( param1, param2, param3 = default.value) { … Continue reading Working with Functions in R
Working with Lists in R
So far I have talked about data structures like Vector, Matrix and Data Frames. Another data structure, which allows us to put other structures in a given order is List. The best part about lists is that the elements of a list can be vector, matrix and data frames. And, they can be part of … Continue reading Working with Lists in R
Working with Data Frames in R (Part II)
In the first blog on data frames, we used existing data frames and saw how to access, filter and sort the members. However, many times you may need to create a new data frame and work with the same. Creating a new Data Frame As you know that the data frames is a list of vectors … Continue reading Working with Data Frames in R (Part II)
Working with Data Frames in R (Part I)
Data Frame is a datatype which is used for storing data in tabular format. Each element of a data frame is a vector of equal length. While matrices also give you a tabular look of the data, you do need to understand the following differences between matrices and data frames. Matrices generally consist of single … Continue reading Working with Data Frames in R (Part I)
Working with Matrices in R
Like Vectors, matrix is a data structure. It is used for storing data in two-dimensional tables with rows and columns of data. Also, like vectors, matrix in R contains a single type of data. Since, often matrix is used for numerical calculations, its elements are often numerical data. Creating Matrix R-provides a method called matrix, … Continue reading Working with Matrices in R
Introduction to matrices for better understanding of data science
What are Matrices? At a very high level, you can think of a Matrix (Plural : matrices) as two dimensional array of numbers, symbols or expressions. For example - following image depicts a MxN matrix, where it has M-rows and N-Columns. A specific element is being denoted by Ai,j, which means the element value at … Continue reading Introduction to matrices for better understanding of data science
Working with Vectors in R
A vector is a sequence of data elements of the same basic data types. In a single vector, you cannot mix different data types. However, if you do so, R will decide the most appropriate data types at runtime. Note In R, you will find the following basic data types : Numeric (e.g. 2, 2.5, … Continue reading Working with Vectors in R