R: Correlation – Finding out relation between data

This article shows how to calculate correlation between two data/variables using R programming language. Correlation calculates the relation between two variables. Positive Correlation: If the value of one variable increases with the increase in value of the another variable then the two variables are said to be positively correlated. Negative Correlation: If the value of … Read more

R: Calculate Mean, Median, Mode, Variance, Standard Deviation

This article shows how to calculate Mean, Median, Mode, Variance, and Standard Deviation of any data set using R programming language. Mean: Calculate sum of all the values and divide it with the total number of values in the data set. > x <- c(1,2,3,4,5,1,2,3,1,2,4,5,2,3,1,1,2,3,5,6) # our data set > mean.result = mean(x) # calculate … Read more

R: Data Visualization – Creating Pie Chart, Bar Chart & Line Graph

This article shows how to create Pie chart, Bar chart & Line graph using R Programming Language. Set Working Directory Set a directory where you want to save the image of pie chart, bar chart & line graph. > print (getwd()) # get current working directory [1] "/home/mukesh" > setwd('/home/mukesh/Documents/training') # set working directory > … Read more

R: Read Write CSV

This article shows how to read and write CSV file with R programming language. We will be manually creating a new CSV file with the following data: rollno,name,gender,age,marks,address 7,Ram,M,22,77,Kathmandu 9,Sita,F,23,88,Bhaktapur 14,Hari,M,24,74,Lalitpur 22,Radha,F,25,65,Bhaktapur 3,John,M,23,90,Kathmandu 11,Jia,F,21,55,Kathmandu We name the CSV file as students.csv. The CSV file contains data of students. It contains roll no, name, gender, age, … Read more

Basic Introduction to R Programming [Beginner Tutorial]

This article aims to introduce the very basics of R programming. This artilce includes R programming introduction, installation, basic syntax, running code, data types, relational operators and functions. 1. Introduction 1.1 What is it? – Programming Language Software – Used for Statistical Analysis & Graphical Representation – Freely available 1.2 What can it do? – … Read more

Magento: Add new column to Product Grid in Admin

This article shows how you can add new columns to product grid (Catalog -> Manage Products) in Magento 1.x admin. For this, you need to rewrite/override the Adminhtml’s catalog_product_grid block class. Here is the block override code to be written in your module’s config.xml file: YourCompany/YourModule/etc/config.xml <global> <blocks> <yourmodule> <class>YourCompany_YourModule_Block</class> </yourmodule> <adminhtml> <rewrite> <catalog_product_grid>YourCompany_YourModule_Block_Adminhtml_Catalog_Product_Grid</catalog_product_grid> </rewrite> … Read more

Magento: Add new column to Customer Grid in Admin

This article shows how you can add new column to customer grid in Magento 1.x admin. In this example, we will be adding a fetching the fax field value from customer’s billing address and showing in the customer grid in Magento admin. For this, you need to rewrite/override the Adminhtml’s customer_grid block class. Here is … Read more

Magento: Add New Column to Sales Order Grid in Admin

This article shows how you can add new columns to sales order grid in Magento 1.x admin. For this, you need to rewrite/override the Adminhtml’s sales_order_gird block class. Here is the block override code to be written in your module’s config.xml file: YourCompany/YourModule/etc/config.xml <global> <blocks> <yourmodule> <class>YourCompany_YourModule_Block</class> </yourmodule> <adminhtml> <rewrite> <sales_order_grid>YourCompany_YourModule_Block_Adminhtml_Sales_Order_Grid</sales_order_grid> </rewrite> </adminhtml> </blocks> </global> … Read more

Magento: Create Order Programmatically

This article show how you can create sales order programmatically through code in Magento 1.x. This code example also includes creating new customer if the customer email is not already registered. It also shows how you can save customer address to the newly created customer. This code has been tested for simple products. Here are … Read more