R Object-oriented Programming

A practical guide to help you learn and understand the programming techniques necessary to exploit the full power of R

R Object-oriented Programming

This ebook is included in a Mapt subscription
Kelly Black

A practical guide to help you learn and understand the programming techniques necessary to exploit the full power of R
$10.00
$44.99
RRP $26.99
RRP $44.99
eBook
Print + eBook
Access every Packt eBook & Video for just $100
 
  • 4,000+ eBooks & Videos
  • 40+ New titles a month
  • 1 Free eBook/Video to keep every month
Find Out More
 
Preview in Mapt

Book Details

ISBN 139781783986682
Paperback190 pages

Book Description

R is best suited to produce data and visual analytics through customizable scripts and commands, instead of typical statistical tools that provide tick boxes and drop-down menus for users. The book is divided into three parts to help you perform these steps. It starts by providing you with an overview of the basic data types, data structures, and tools available in R that are used to solve common tasks. It then moves on to offer insights and examples on object-oriented programming with R; this includes an introduction to the basic control structures available in R with examples. It also includes details on how to implement S3 and S4 classes. Finally, the book provides three detailed examples that demonstrate how to bring all of these ideas together.

Table of Contents

Chapter 1: Data Types
Assignment
The workspace
Discrete data types
Summary
Chapter 2: Organizing Data
Basic data structures
Operations on data structures
Summary
Chapter 3: Saving Data and Printing Results
File and directory information
Entering data
Printing results and saving data
Primitive input/output
Network options
Summary
Chapter 4: Calculating Probabilities and Random Numbers
Overview
Chapter 5: Character and String Operations
Basic string operations
Six focused tasks
Regular expressions
Summary
Chapter 6: Converting and Defining Time Variables
Introduction and assumptions
Converting strings to time data types
Summary
Chapter 7: Basic Programming
Conditional execution
Summary
Chapter 8: S3 Classes
Defining classes and methods
Defining objects and inheritance
Encapsulation
A final note
Summary
Chapter 9: S4 Classes
Introducing the Ant class
Defining an S4 class
Defining methods for an S4 class
Inheritance
Miscellaneous notes
Summary
Chapter 10: Case Study – Course Grades
Overview
The Course class
The assignment classes
Defining indexing operations
Redefining existing functions
Redefining arithmetic operations
Summary
Chapter 11: Case Study – Simulation
The simulation classes
The Monte-Carlo class
Examples
Summary

What You Will Learn

  • Understand the fundamental data types and data structures in R
  • Explore the basic commands and tools to aid in addressing common tasks
  • Use the primary control structures in R to implement algorithms
  • Use and develop S3 and S4 classes
  • Discover the differences between S3 and S4 classes
  • Bring different ideas together to solve common problems
  • Understand the fundamental design and approach to object-oriented programming in R

Authors

Table of Contents

Chapter 1: Data Types
Assignment
The workspace
Discrete data types
Summary
Chapter 2: Organizing Data
Basic data structures
Operations on data structures
Summary
Chapter 3: Saving Data and Printing Results
File and directory information
Entering data
Printing results and saving data
Primitive input/output
Network options
Summary
Chapter 4: Calculating Probabilities and Random Numbers
Overview
Chapter 5: Character and String Operations
Basic string operations
Six focused tasks
Regular expressions
Summary
Chapter 6: Converting and Defining Time Variables
Introduction and assumptions
Converting strings to time data types
Summary
Chapter 7: Basic Programming
Conditional execution
Summary
Chapter 8: S3 Classes
Defining classes and methods
Defining objects and inheritance
Encapsulation
A final note
Summary
Chapter 9: S4 Classes
Introducing the Ant class
Defining an S4 class
Defining methods for an S4 class
Inheritance
Miscellaneous notes
Summary
Chapter 10: Case Study – Course Grades
Overview
The Course class
The assignment classes
Defining indexing operations
Redefining existing functions
Redefining arithmetic operations
Summary
Chapter 11: Case Study – Simulation
The simulation classes
The Monte-Carlo class
Examples
Summary

Book Details

ISBN 139781783986682
Paperback190 pages
Read More

Read More Reviews