Showing posts with label Tutorial. Show all posts
Showing posts with label Tutorial. Show all posts

Sunday, January 25, 2015

How to Create and Publish R package on CRAN : Step-by-Step Guide

Requirements:
  • R Studio (This tutorial is based on R studio 0.98.501)
  • Beginner level R programming skills
  • devtools package (to build and compile the code)
  • roxygen2 package (to create the documentation)
Lets break it down into 7 simple steps as following:
  1. Create R project
  2. Create function(s)
  3. Create  description file
  4. Create help file(s)
  5. Build, load and check the package
  6. Export package
  7. Submit on CRAN
Step 1

1.1  Open R Studio. Create a new project using "file > new project > new directory > empty project". Give directory name.


Wednesday, August 27, 2014

Useful Unix commands for exploring data

While dealing with big genetic data sets I often got stuck with limitation of programming languages in terms of reading big files. Also sometimes it is not convenient to load the data file in Python or R in order to perform few basic checks and exploratory analysis. Unix commands are pretty handy in these scenarios and often takes significantly less time in execution.

Lets consider movie data set from some parallel universe (with random values) for this assignment. There are 8 fields in total,



Tuesday, May 13, 2014

Create network with igraph in 4 simple steps

Lets say, we have a data-frame with node-node-edge values as following,


Now we will build a network based on this data.

Step 1: Load the data and do basic validity checks.

Thursday, February 13, 2014

R Markdown using R Studios


R has markdown functionality (similar to IPython) packages which helps us to create web reports and dynamic web content. Lets go through a quick tutorial about creating a R Markdown.

Make sure you have latest version of R Studio and following two packages installed:

  • knitr 
  • markdown

Open R studio, click File > New File > R Markdown

Saturday, November 2, 2013

Hadoop Hands-On exercise with Hortonworks: HiveQL basics

This is second post in the Hadoop hands-on series. In last post we have,
  1. Hadoop instance running
  2. Data uploaded in HDFS and HCatalog
In this post we query the data using Hadoop. HiveQL is the query language similar to SQL. We will use it to query the data stored in Hadoop clusters.    

Go to Hue > Beeswax (User interface for HiveQL)


Monday, October 28, 2013

Hadoop Hands-On exercise with Hortonworks: Setting up Hadoop sandbox and loading the data

Requirements:
1. You have a software like VitualBox, VMware, Hyper -V installed which can deal with the virtual environment.
2. You have downloaded appropriate sandbox image from here.
3. You have minimum 4 GB RAM
4. Optional: To get familiar with few basic concepts referred in this post (like HDFS, node) you might like to read previous post here. 

Lets get started!

Load the downloaded file, which is "Hortonworks+Sandbox+1.3+VirtualBox+RC6.ova" in my case  and start the virtual machine.

Sunday, September 29, 2013

Excel tricks for cleaning data

In this post lets talk about few simple Excel tricks which are handy to clean small datasets.

 How can we split text from one column into multiple columns?
  • Sometime you might have a time stamp in given column but you want date and time in separate column for analysis.
  • Select the column of interest, go to Data tab in excel and click in "Text to columns".
  • You will get a popup window. In first step here we can select if we want to split column based on fixed width or based a delimiter character. Lets select delimiter and click on next.

Saturday, September 28, 2013

Mongodb: Loading and querying the data

This blog post explains how can we load data from json files and perform simple queries on it. If you wish to install and configure the mongodb, please refer previous post abut the same.

Building database

You can go to mongo shell by clicking on "mongo" or running "./mongo" in bin folder. You can use following simple command to get list of all databases,

> show dbs
admin 0.03125GB
local(empty)

MongoDB: Installation and configuration

This post talks about installing and configuring MongoDB.

Installation:

Go to http://www.mongodb.org/downloads and refer the production release section. Go to corresponding operating system, in this case OS X and click on download. Prefer 64 bit version.[1]

Decompress the downloaded file. Rename the folder as mongodb. You will get a bin directory and few other files. In bin directory there are two files which we will use most frequently, called "mongo" and "mongod". The "mongo" executable will be used to start interactive mongo shell and "mongod" will be used to start mongodb server.

Friday, June 28, 2013

Exploring Data - 1: Descriptive statistics using Excel

Excel might be one of the easiest way to get familiar with the raw data. Lets consider the US household income by state data set from here for 2009.

Before we start the tutorial make sure Analysis toolpack excel add-in is enabled. You can check it by File > Options > Add-ins.


Now make sure the data we need is in Excel file. Go to Data  >  Data Analysis.