0% found this document useful (0 votes)
13 views17 pages

12-Jul-2021 My R Data Analytics - Basics

This document provides instructions for performing data analysis operations on Amazon book review and Facebook metrics datasets using R. It discusses importing csv files, creating data subsets, merging datasets, sorting data, transposing data, melting data to long format, and casting data to wide format. Prerequisites include familiarity with basic R programming. Code examples are provided using functions like read.csv(), subset(), merge(), sort(), t(), melt(), and cast() to demonstrate the various data manipulation tasks.

Uploaded by

Roy Goyal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views17 pages

12-Jul-2021 My R Data Analytics - Basics

This document provides instructions for performing data analysis operations on Amazon book review and Facebook metrics datasets using R. It discusses importing csv files, creating data subsets, merging datasets, sorting data, transposing data, melting data to long format, and casting data to wide format. Prerequisites include familiarity with basic R programming. Code examples are provided using functions like read.csv(), subset(), merge(), sort(), t(), melt(), and cast() to demonstrate the various data manipulation tasks.

Uploaded by

Roy Goyal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

R Data Analytics – Basic

Tushar B. Kute,
http://tusharkute.com
Prerequisites

• Please read the previous presentations on


R Programming. Follow the below link:
http://mitu.co.in/r­presentations 
Problem Statement:

• Perform the following operations using R on the


Amazon book review and facebook metrics data
sets
1) Create data subsets
2) Merge Data
3) Sort Data
4) Transposing Data
5) Melting Data to long format
6) Casting data to wide format
Facebook Metrics : Download
The dataset

fb.csv
Import the dataset

• read.csv()
– Reads a csv file in table format and creates a
data frame from it, with cases corresponding to
lines and variables to fields in the file.
Import the dataset
Reads csv file

No. of columns

No. of rows

First six entries


Creating the subset

Create subset

Store in csv file


Creating the subset

• subset( )
– Return subsets of vectors, matrices or data frames which
meet conditions.
– Usage:
subset(x, ...)
## Default S3 method:
subset (x, subset, ...)
## S3 method for class 'matrix'
subset (x, subset, select, drop = FALSE, ...)
## S3 method for class 'data.frame'
subset (x, subset, select, drop = FALSE, ...)
Creating the subset

Subset condition
New dataset of same columns

newfb.csv
Merge Datasets

Shows the dimensions (rows, columns

Binds both data frames


Sort Datasets

Sort by share
- for descending
Transpose Datasets

Finds the transpose


Melt data to long format

Melt the dataset


Casting dataset
Thank you
This presentation is created using LibreOffice Impress 5.1.6.2, can be used freely as per GNU General Public License

/mITuSkillologies @mitu_group

Web Resources
http://mitu.co.in
http://tusharkute.com

[email protected]

You might also like