Free Sample
+ Collection

Data Manipulation with R

Jaynal Abedin

Written for intermediate to advanced users of R, this tutorial will enhance your data manipulation capabilities considerably. It takes you step-by-step through the tools and techniques needed to enable analysis and visualization.
RRP $17.99
RRP $29.99
Print + eBook

Want this title & more?

$16.99 p/month

Subscribe to PacktLib

Enjoy full and instant access to over 2000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

Book Details

ISBN 139781783281091
Paperback102 pages

About This Book

  • Perform factor manipulation and string processing
  • Learn group-wise data manipulation using plyr
  • Handle large datasets, interact with database software, and manipulate data using sqldf

Who This Book Is For

This book is aimed at intermediate to advanced level users of R who want to perform data manipulation with R, and those who want to clean and aggregate data effectively. Readers are expected to have at least an introductory knowledge of R and some basic administration work in R, such as installing packages and calling them when required.

Table of Contents

Chapter 1: R Data Types and Basic Operations
Modes and classes of R objects
R object structure and mode conversion
Factor and its types
Missing values in R
Chapter 2: Basic Data Manipulation
Acquiring data
Factor manipulation
Date processing
Character manipulation
Subscripting and subsetting
Chapter 3: Data Manipulation Using plyr
The split-apply-combine strategy
Utilities of plyr
Comparing default R and plyr
Chapter 4: Reshaping Datasets
The typical layout of a dataset
The new layout of a dataset
Reshaping the dataset from the typical layout
Reshaping the dataset with the reshape package
The reshape2 package
Chapter 5: R and Databases
R and different databases
Relational databases in R
R and sqldf
Data manipulation using sqldf

What You Will Learn

  • Learn R data types and their basic operations
  • Deal efficiently with string, factor, and date
  • Understand group-wise data manipulation
  • Work with different layouts of the R dataset and interchange between layouts for different purposes
  • Connect R with database software to manage relational databases
  • Manage bigger datasets using R
  • Manipulate datasets using SQL statements through the sqldf package

In Detail

One of the most important aspects of computing with data is the ability to manipulate it to enable subsequent analysis and visualization. R offers a wide range of tools for this purpose. Data from any source, be it flat files or databases, can be loaded into R and this will allow you to manipulate data format into structures that support reproducible and convenient data analysis.

This practical, example-oriented guide aims to discuss the split-apply-combine strategy in data manipulation, which is a faster data manipulation approach. After reading this book, you will not only be able to efficiently manage and check the validity of your datasets with the split-apply-combine strategy, but you will also learn to handle larger datasets.

This book starts with describing the R object’s mode and class, and then highlights different R data types, explaining their basic operations. You will focus on group-wise data manipulation with the split-apply-combine strategy, supported by specific examples. You will also learn to efficiently handle date, string, and factor variables along with different layouts of datasets using the reshape2 package. You will learn to use plyr effectively for data manipulation, truncating and rounding data, simulating data sets, as well as character manipulation. Finally you will get acquainted with using R with SQL databases.


Read More

Recommended for You