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

Kelly Black

A practical guide to help you learn and understand the programming techniques necessary to exploit the full power of R
Mapt Subscription
FREE
$29.99/m after trial
eBook
$18.90
RRP $26.99
Print + eBook
$44.99
RRP $44.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$18.90
$44.99
$29.99p/m after trial
RRP $26.99
RRP $44.99
Subscription
eBook
Print + eBook
Start 30 Day Trial
Subscribe and access every Packt eBook & Video.
 
  • 5,000+ eBooks & Videos
  • 50+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 
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